Subject TIB_Query and SQL Statements, Off-topic
Author David Husarik
Hi Group;

Is it possible to setup the SQL statement in a
TIB_Query component as follows.

DECLARE VARIABLE aNumber INTEGER
aNumber = :theNumber

if (aNumber = 1) then
select * from table_A where ID = :ID
else
if (aNumber = 2) then
select * from table_A where NAME LIKE
'%'||:NAME||'%'
else
if (aNumber = 3) then
select * from table_A where CITY LIKE
'%'||:CITY||'%'

Is this statement valid?
Another question, is this the correct syntax for a
like statement. I have used this syntax in stored
procedures and it seems to work about 50% of the time.
Sometimes I get the results I expect other times I do
not.

TIA
David Husarik


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/