What is this Site!!

All about Real time requirements in Orale Stay Tune!!
Showing posts with label values back to unix. Show all posts
Showing posts with label values back to unix. Show all posts

Sunday, October 7, 2007



Passing values back to unix script from sqlplus

Sometimes while calling sql scripts from shell scripts, it is required that you find out thatwhether the scripts failed or not. This is more imperative if you have a dependency between jobs. following is an example of this.



write following code in sql script
set echo on
whenever sqlerror exit 1
whenever oserror exit 2
--your code--
exit 0
write following code in shell script to receive the value
--call sql script
ret_val=$?

now ret val will have value 0 if sql script did not fail and 1 or 2 otherwise