Subject [IBO] Re: Problems using IB_Query and IBOQuery
Author Svein Erling Tysvær
Around constants you should use apostrophes, not double quotes (In Delphi this means that you have to double the apostrophes).

The closest you can get to what you wrote (although Helen's answer may be preferable), is:

IB_Query1.SQL.Text:=' Select * from TABLE where ("FIELD" like ''%'+ edit1.text + '%''') ';

By the way, double quotes around field names are only necessary if you want case sensitive field names or use reserved words as field names.

HTH,
Set

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf Of aztoquetti
Sent: 19. august 2009 04:57
To: IBObjects@yahoogroups.com
Subject: [IBO] Re: Problems using IB_Query and IBOQuery

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?

Tks.