Page 1 of 1

Conditional Stored Procedure execution

Posted: Tue Mar 19, 2013 6:37 am
by datastagenewbie
How do I execute stored procedures on conditions in Server Job , ODBC stage? If statements are giving me errors.

Posted: Tue Mar 19, 2013 7:18 am
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.

Posted: Tue Mar 19, 2013 7:48 am
by datastagenewbie
Actually, I was able to use the IF statement. There was a syntax error, which was causing the job to fail . Thanks!

Posted: Tue Mar 19, 2013 8:00 am
by chulett
Really? Huh, learned something new. Perhaps an "ODBC thing"... could you post the syntax you used for me, please?

Posted: Tue Mar 19, 2013 8:09 am
by prasannakumarkk
are u mentioning anonymous blocks here