Board index » delphi » Help: Using local SQL verb LIKE with delphi 1 application

Help: Using local SQL verb LIKE with delphi 1 application

Can someone please show me what I'm doing wrong.

I have a simple application accessing a single table paradox database, I
initially open the Query with an SQL string 'SELECT * FROM stable' where
stable is a string holding the database table name.

This works and the grid displays all the entries from the table.

I then Close the Query, do an SQL Clear and Add and Open the Query again
to select a sub-set of the records, this fails every time.

I want to select records where a string field contains another sub-string,
like all records containing the word 'hamster' in the Title field.

I am trying to use the LIKE verb but no matter how I quote/arrange the SQL
string it always returns an empty set and the grid clears?

Can someone e-mail me examples of this verb and/or that they know have
worked under delphi 1.

Any help would be greatly appreciated

Ian McCarthy
ianjmccar...@enterprise.net

 

Re:Help: Using local SQL verb LIKE with delphi 1 application


Ian McCarthy <ianjmccar...@enterprise.net> skrev i artiklen
<01bd25b7$b5c26220$14d4d...@able.casella.co.uk>...

Quote
> Can someone please show me what I'm doing wrong.

> I have a simple application accessing a single table paradox database, I
> initially open the Query with an SQL string 'SELECT * FROM stable' where
> stable is a string holding the database table name.

> This works and the grid displays all the entries from the table.

> I then Close the Query, do an SQL Clear and Add and Open the Query again
> to select a sub-set of the records, this fails every time.

> I want to select records where a string field contains another
sub-string,
> like all records containing the word 'hamster' in the Title field.

> I am trying to use the LIKE verb but no matter how I quote/arrange the
SQL
> string it always returns an empty set and the grid clears?

> Can someone e-mail me examples of this verb and/or that they know have
> worked under delphi 1.

> Any help would be greatly appreciated

> Ian McCarthy
> ianjmccar...@enterprise.net

try

SELECT *`FROM stable WHERE
Title =  '%hamster%'

Hendrik Johns

Other Threads