Page 1 of 1

sql error

Posted: Tue Nov 03, 2009 12:29 pm
by pandujoy
can anyone figureout what exactly is missing in this sql

if ORCHESTRATE.usage = "ALL" and entity_at.id = ORCHESTRATE.id THEN
SELECT * FROM comm_at
ELSE
SELECT * FROM entity_at WHERE end_dt >= sysdate
and entity_at.id = ORCHESTRATE.id
end if;

Not sure what the error is

Posted: Tue Nov 03, 2009 12:38 pm
by Sreenivasulu
You should avoid using * in the select. Better use the column names along with the alias.

I think you can debug also faster.

Regards
Sreeni

Posted: Tue Nov 03, 2009 12:55 pm
by pandujoy
Sreenivasulu wrote:You should avoid using * in the select. Better use the column names along with the alias.

I think you can debug also faster.

Regards
Sreeni
thanks for the reply Sreeni...infact i have try that too but i guess something is missing the sql itslef.

Posted: Tue Nov 03, 2009 1:33 pm
by chulett
Hard to say unless you post the actual error. Your db supports if-then-else constructs? :?