Home » Developer & Programmer » JDeveloper, Java & XML » How to get the Error Status in Shell Variable
icon5.gif  How to get the Error Status in Shell Variable [message #132995] Wed, 17 August 2005 03:50
purveshvora
Messages: 6
Registered: August 2005
Location: Mumbai
Junior Member
Dear Friends,

This is my first post to this forum...

I have foll. code..
DBLOGIN=${ORALOADUSER}/${ORALOADPASSWD}@${ORACLE_SID}
RETVAL=`$ORACLE_HOME/bin/sqlplus -s /nolog <<EOF
set pagesize 0 feedback off verify off heading off echo off
connect ${DBLOGIN}
set serveroutput on
WHENEVER SQLERROR EXIT 1
DECLARE
.
.
.
.

I am checking the status as
status=$?
echo after calling procedure status=${status}
if [ ${status} -ne 0 ]
then
echo "*******Error while executing procedure*******"
exit 1
fi


If there is any error in the procedure it works properly...
BUT if I provide wrong uid/pwd of Oracle then it returns 0 instead of ERROR....
Ideally it should return 1..
Can anybody please help me on this...
How do I check whether its connected to oracle or not...

Thanks in advance.

Previous Topic: Java Applet ->Oracle DB
Next Topic: XMLDOM import performance
Goto Forum:
  


Current Time: Fri Apr 26 10:22:38 CDT 2024