sql error

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

sql error

Post 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
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post 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
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hard to say unless you post the actual error. Your db supports if-then-else constructs? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply