Conditional Stored Procedure execution

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
datastagenewbie
Participant
Posts: 64
Joined: Tue Sep 23, 2008 9:54 am

Conditional Stored Procedure execution

Post by datastagenewbie »

How do I execute stored procedures on conditions in Server Job , ODBC stage? If statements are giving me errors.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't. Split the flow and only send the ones needing the SP call down one branch, all others down another. Join the stream back together after that. That or call it each time and conditionally use the result. Of course, that depends on what exactly it is your SP is doing.

Another option - code the SP itself to be conditional. Always call it but pass it an argument so it knows whether it should 'execute' itself or not.
-craig

"You can never have too many knives" -- Logan Nine Fingers
datastagenewbie
Participant
Posts: 64
Joined: Tue Sep 23, 2008 9:54 am

Post by datastagenewbie »

Actually, I was able to use the IF statement. There was a syntax error, which was causing the job to fail . Thanks!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Really? Huh, learned something new. Perhaps an "ODBC thing"... could you post the syntax you used for me, please?
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

are u mentioning anonymous blocks here
Thanks,
Prasanna
Post Reply