How to Capture error if SQL Proc inside Unix fails

How to Capture error if SQL Proc inside Unix fails

 

  



Hi All



I am executing the below shell .The Sql Proc fails but still no error is
captured and value of $? Remains 0.



#!/bin/ksh



sqlplus -s fw295/[Email Address Removed] <<ExitF



set timi on;



WHENEVER SQLERROR EXIT 1



exec load_avg_monthly_usage;



ExitF



if [ $? -ne 0 ] ;



then



echo "Creating Remedy Ticket for Abu" >>
/u01/home/hcs/its/log/load_demand.log



else



echo "No ticket raised" >> /u01/home/hcs/its/log/load_demand.log



fi





Could anyone help??



Manish




Oracle LazyDBA home page