October 13, 2008, 04:34 PM
SteveMCheck parameter value using sql passthru
I'm calling a PL/sql procedure using sql passthru.
This procedure returns a return code. I want to check the value of the return code and fail the DM procedure in a process flow by setting it's return code.
ENGINE SQLORA SET DEFAULT_CONNECTION dvdss01
SQL SQLORA
EX DWSTAGE.truncate_table '&table_name', ?/12345;
END
November 05, 2008, 02:54 PM
BarbaraAHi,
Did you try testing &RETCODE after calling the stored procedure? For example:
ENGINE SQLORA SET DEFAULT_CONNECTION dvdss01
SQL SQLORA
EX DWSTAGE.truncate_table '&table_name', ?/12345;
END
-IF &RETCODE NE 0 GOTO BADRUN;
-EXIT
-BADRUN
-TYPE put message text here
-* put what you want to have happen here
-EXIT
With this, if the return code is 0, it will exit. If it is not 0, it will fall through to the error handling.
Hope that helps!
...