Subject | Re: [firebird-support] SQL.Add(StrList) - How do you add a quoted string to a query |
---|---|
Author | Martijn Tonies |
Post date | 2013-01-29T18:34:39Z |
Hello Craig,
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!
> My code looks like this:qr.SQL.Add('GIS_CONFIG.GIS_CONFIG = ' + QuotedStr(strList.Text) );
>
> 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+'''');
> qry.SQL.Add('Where');That should do it. QuotedStr doubles all single quotes in the text and will
> qry.SQL.Add('(');
> qry.SQL.Add(UserPKBig);
> qry.SQL.Add(')');
> qry.Open;
> qry.Close;
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!