Subject | Using "or" in sqlwhereitems |
---|---|
Author | James Chua |
Post date | 2003-11-26T07:36:09Z |
Good day.
I have a ib_query which have sql properties and sqlwhereitems assign on
runtime. For example in runtime I have assign to following:
ib_query.sql.add('select id, name from supplier');
ib_query.sqlwhereitems.add('or name like ''%hardware%" or name like
''%auto%" or name like ''%supply%''');
I expect only the records with name field containing the word hardware,
auto, and supply will be the result, instead the ib_query return all the
record?
I think the problems is because the first line of the sqlwhereitems have
"or" as the first word.
I have a ib_query which have sql properties and sqlwhereitems assign on
runtime. For example in runtime I have assign to following:
ib_query.sql.add('select id, name from supplier');
ib_query.sqlwhereitems.add('or name like ''%hardware%" or name like
''%auto%" or name like ''%supply%''');
I expect only the records with name field containing the word hardware,
auto, and supply will be the result, instead the ib_query return all the
record?
I think the problems is because the first line of the sqlwhereitems have
"or" as the first word.