Using SQL*Plus in Batch Environment

From: Randy Lewis <rlewis_at_systemhouse.mci.com>
Date: 1998/02/13
Message-ID: <34E487DB.7AC61EE6_at_systemhouse.mci.com>#1/1


[Quoted] Question to the Knowledgible,

I am attempting to use SQL*Plus in an un-attended batch environment. We [Quoted] are using Korn shell under Solaris. I want the ability to detect an unsuccessful attempt at logging into the Oracle database using SQL*Plus. I have tried testing the return code in the shell, but all I [Quoted] get is zero. Only if I fail the login attempt three times does SQL*Plus [Quoted] return a non-zero return code; but in an un-attended batch environment [Quoted] it will only attempt one login and then abort.

Shell Script:

  if sqlplus userid/password _at_$SQL_DIR/sql.sql 2>&1 1>logfile   then
    :
  else
    echo ERROR occured during SQLPlus run...     exit 1
  fi

The above code produces a return code of zero if the userid or the password is invalid. Any help would be appreciated.

Randy Received on Fri Feb 13 1998 - 00:00:00 CET

Original text of this message