Unanswered: KSH script to call a sql if there is an error
Can some one help me please.
I am new to korn shell scripting and need some help
I have to code a ksh :
I execute a db2 sql and if throws an error(Say DB21034E), I have to call a sql script.
The shell script is already written for the following scenario, need help for the above mentioned scenario
When an error occurs, I should create a dynamic permanent db2 table and then call a sql script.
The ksh variable $? contains the result of the last executed command. It is zero if the command terminated normally, and non zero if it did not.
You should test the value of the variable at the command line to confirm its values.
If the value is always zero, that is, the processing of the error still results is a normal termination. then you should add sql code to output a status, and then examine the status instead of the $? variable.