[fpc-pascal] @Michael Van Canneyt or others: exporting SQL (issue 19937)

Reinier Olislagers reinierolislagers at gmail.com
Sat Mar 17 10:53:56 CET 2012


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



More information about the fpc-pascal mailing list