Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> SQL + Return Code ?, 8i
Oracle 8i
SQL+ 3.3.4
I'm starting SQL+ from a shell script and checking the return code to make
sure everything worked ok. Here is how I start it:
sqlplus -s $USRID/$USRPWD @${BASE_DIR}/local/bin/test.sql 2>/dev/null 1>&2
I'm returning, using a bind variable, 0 if my sql runs ok and 2 otherwise. However, according to the Oracle documentation I should get FAILURE returned if the logon fails. FAILURE is system dependent and is 1 where I am running. The problem is that when the logon fails sqlplus hangs waiting for another logon try (up to three) before returning FAILURE. Since my shell script will run from cron this isn't a good thing. Is there some way to get sqlplus to return FAILURE if the initial logon attempt fails? I wish there was some sqlplus option (-whatever) that would specify only one logon attempt.