All Forums UDA
UpaMishra 35 posts Joined 01/08
02 Jun 2009
Executing teradata procedures in unix shell scripts

sqlplus -s /nolog @/rsl/app/upendra/login.sql << EOFset serveroutput onset timing onexec CAT_CHCONFIG_APP('M','1');EOFCAT_CHCONFIG_APP is an oracle procedure.Is there any way to run teradata procedures in shell scripts.

lathavim 7 posts Joined 05/09
03 Jun 2009

bteq << EOF.logon $SERV/$USERNAME,$PASSWORDcall 'procedure name()' .quitEOF

rahul.nityanand 2 posts Joined 04/11
27 Apr 2011

is there a way by which I can capture the SQL errors from the Stored Procedure in the Unix script that calls the Stored Procedure ??

mnylin 118 posts Joined 12/09
27 Apr 2011

You can configure your BTEQ script to exit whenever an error level occurs that is above a given threshold. the .SET MAXERROR statement achieves this. Alternatively, you can check the error level after each call to a stored procedure and use conditional logic to either continue or exit. But all that you'll be able to pass back to the shell script is (I believe) a single byte standard return code value. So no SQL error codes.

If you need to have the SQL error codes available in UNIX, you can export the error codes to a log file or store them in a database log table and then extract the contents of said table.

Hope this helps.

You must sign in to leave a comment.