Subject Re: [IBO] Re: Problems using IB_Query and IBOQuery
Author Helen Borrie
At 12:56 PM 19/08/2009, you wrote:
>Hello everyone.
>
>First of all, thanks everyone who answered my first doubt here.
>
>I got one more. That's still about SQL script. But now I just wanna know which syntax I must use to run a script.
>
>In BDE (component TQuery), I used to run this script
>
>' Select * from TABLE where ("FIELD" like "%'+ edit1.text + '%") '
>
>I used this when i searched a substring (edit1.text) on table TABLE and on field FIELD, but components IB_Query and IBOQuery dont accept the operator "%". Is there any other operator I can use instead to do this query, or another way to do the query?

var
compstring:string;
....
begin
....
compstring := '%' + edit1.text;
with myquery do begin
SQL.clear;
SQL.add('Select * from TABLE ');
SQL.add('where "FIELD" like ' + quotedstr(compstring));
...

Helen