Page 1 of 1

TIBCQuery: SQL syntax???

Posted: Sun 18 Apr 2010 20:15
by mwk
Actually, I'm converting a BDE application to a program using firebird server. I have a table DBUSERS with two data fields: USERNO AND USERNAME, I use a TIBCQuery:

with IBCQuery1 do begin
Close;
SQL.Clear;
SQL.Add('SELECT * FROM dbusers WHERE username LIKE "A%"');
Open;
end;

The result is the following error:
Dynamic SQL Error
SQL error code; -206
Column unknown
A%
At line 1, column 38

What is the correct syntax for string operations???

Posted: Mon 19 Apr 2010 08:40
by Dimon
To solve the problem use single quotes instead of double, like this:

Code: Select all

SQL.Add('SELECT * FROM dbusers WHERE username LIKE ''A%'' '); 

Posted: Tue 01 Jun 2010 23:15
by mwk
Thank you!!! Now, it works fine...