Hi Edward /All
I am using the below code in Shell to invoke Sql plus and call proc -
sqlplus -s fw295/[Email Address Removed] <<ExitF
set timi on;
whenever sqlerror exit 1
declare
begin
load_avg_monthly_usage;
end;
/
ExitF
After that I am using this code to trap the Sql error -
if [ $error -ne 0 ]
then
echo "Creating Remedy Ticket for Abu" >>
/u01/home/hcs/its/log/load_demand.log
CreateTicket
exit 1
fi
But this doesn't seem to work ...
Any Help ??
"Truth is incontrovertible. Panic may resent it; ignorance may deride it;
malice may distort it; but there it is."
-- Winston Churchill
_________________________________
Manish kalra
Systems Executive
KPIT Cummins Infosystems ltd
35&36 , Rajiv Gandhi Infotech park,
Phase -1 , MIDC,
Hinjewadi , Pune - 411057
INDIA
Phone - 020 - 56525000
-----Original Message-----
From: Edward F Eaglehouse
[mailto:oracledba-ezmlmshield-x58720581.[Email address protected]
Sent: Thursday, January 05, 2006 1:49 AM
To: LazyDBA Discussion
Subject: RE: How to Capture error , if a SQL Procedure fails inside a Unix
shell
Manish--
I assume you're using SQL*Plus to call your script from within the shell
script.
The EXIT command will take an argument that will be passed back to the shell
as the result from sqlplus. Alternatively, if you just need to know there
was an error, you can insert "WHENEVER SQLERROR EXIT 1" command in your SQL
script to identify a failure.
In my PL/SQL scripts, I use a bind variable, EXIT, and assign exit codes
where appropriate. At the end of the script I insert EXIT :EXIT so sqlplus
returns the exit code.
--
Cordially,
Edward F Eaglehouse
-----Original Message-----
From: manish
[mailto:oracledba-ezmlmshield-x78285482.[Email address protected]
Sent: Wednesday, January 04, 2006 06:53
To: LazyDBA Discussion
Subject: How to Capture error , if a SQL Procedure fails inside a Unix
shell
Hi All
I have called an SQL Proc inside my shell.Now I want to update a log file in
case the Process fails due to some reason..
Can anyone provide any input on that ??
Thanking in advance.
"Truth is incontrovertible. Panic may resent it; ignorance may deride it;
malice may distort it; but there it is."
-- Winston Churchill
_________________________________
Manish kalra
Systems Executive
KPIT Cummins Infosystems ltd
35&36 , Rajiv Gandhi Infotech park,
Phase -1 , MIDC,
Hinjewadi , Pune - 411057
INDIA
Phone - 020 - 56525000
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page