Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-03

@Michael Van Canneyt or others: exporting SQL (issue 19937)

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Good morning Michael & the rest,

Would any of you committers who are familiar with SQL check to see if my patch at
http://bugs.freepascal.org/view.php?id=19937
is correct and implement it?

Currently, exporting a dataset using TSQLExporter, it generates INSERT SQL statements which quote string fields with a single quote: '. However, it does not quote memo or blob fields, causing errors when running the resulting SQL if any memo or blob fields contains (e.g.) '

I fixed it by changing

  If (F.DataType in StringFieldTypes+DateFieldTypes) then
    Result:=''''+QuoteFIeld(Result)+'''';

to
If (F.DataType in
BlobFieldTypes+StringFieldTypes+MemoFieldTypes+DateFieldTypes) then

    Result:=''''+QuoteFIeld(Result)+'''';

(see patch in mantis)

Marco van de Voort kindly had a look but indicated he's not that deep into the dataset exporting code. (I only just noticed his comment in mantis, sorry)

Thanks a lot,
Reinier

Reply by email

Michael Van Canneyt
to Reinier Olislagers
Reinier Olislagers wrote 20 lines
Good morning Michael & the rest, Would any of you committers who are familiar with SQL check to see if my patch at http://bugs.freepascal.org/view.php?id=19937 is correct and implement it? Currently, exporting a dataset using TSQLExporter, it generates INSERT SQL statements which quote string fields with a single quote: '. However, it does not quote memo or blob fields, causing errors when running the resulting SQL if any memo or blob fields contains (e.g.) ' I fixed it by changing If (F.DataType in StringFieldTypes+DateFieldTypes) then Result:=''''+QuoteFIeld(Result)+''''; to If (F.DataType in BlobFieldTypes+StringFieldTypes+MemoFieldTypes+DateFieldTypes) then Result:=''''+QuoteFIeld(Result)+'''';

Checked and applied, thank you very much.

Database related bugs are automatically assigned to Joost, that's why I don't see them in my list of assigned bugs.

So feel free to bug me if you think I can/should handle them.

Michael.

Reply by email

Reinier Olislagers
to Michael Van Canneyt
Michael Van Canneyt wrote 13 lines
On Sat, 17 Mar 2012, Reinier Olislagers wrote: > Would any of you committers who are familiar with SQL check to see if my > patch at > http://bugs.freepascal.org/view.php?id=19937 > is correct and implement it? Checked and applied, thank you very much. Database related bugs are automatically assigned to Joost, that's why I don't see them in my list of assigned bugs. So feel free to bug me if you think I can/should handle them. Michael.

Thanks, Michael!

Regards,
Reinier

Reply by email

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 8 lines
In our previous episode, Michael Van Canneyt said: > Checked and applied, thank you very much. > > Database related bugs are automatically assigned to Joost, that's why I don't > see them in my list of assigned bugs. I happened to be walking over database bugs when I read this, so I helpfully assigned some more exporting related bugs to you :-)

I noticed :)

One of them is easy, the other requires some investigation.

Michael.

Reply by email