Subject Re: [firebird-support] SQL.Add(StrList) - How do you add a quoted string to a query
Author Martijn Tonies
Hello Craig,

> My code looks like this:
>
> qry.SQL.Clear;
> qry.SQL.Add('UPDATE');
> qry.SQL.Add('GIS_CONFIG');
> qry.SQL.Add('SET');
> qry.SQL.Add('GIS_CONFIG.GIS_CONFIG=+''''+strList.Text+'''');

qr.SQL.Add('GIS_CONFIG.GIS_CONFIG = ' + QuotedStr(strList.Text) );

> qry.SQL.Add('Where');
> qry.SQL.Add('(');
> qry.SQL.Add(UserPKBig);
> qry.SQL.Add(')');
> qry.Open;
> qry.Close;

That should do it. QuotedStr doubles all single quotes in the text and will
surround by single quotes.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!