Is there anyway to get a script to stop running if an error occurs. In microsft sql server running isql with the -b paramter does this but in sybase the -b parameter disables the display of the table headers output.
customizes the error message display. For errors of the severity level specified or higher, only the message number, state, and error level are displayed; no error text appears. For error levels lower than the specified level, nothing appears.
Ive tried running the isql with -m1 and -m0 however I still recieve error messages during the script run without it "bombing out". Even the unix return code seems to be 0.
the SQLscript.sql is creating a SP and runinng it.
For testing purposes, the SP fails and return some error message like this one:
Msg 99999, Level 16, State 1:
Server 'xyz', Proc 'SP_blabla', line 123:
SP_blabla: some error message
(return status = 99999)
Now, back in Unix, the return code of the iSQL command is still 0 !
I want it to report failure!!!
In ORACLE, I would have write "WHENEVER SQLERROR EXIT FAILURE ROLLBACK" in the sql script.
For some resons, I can't have sybase isql to report an error to the calling script in Unix.