Re: SQL*Plus question

From: Mike Gold <Michael.Gold_at_DaytonOH.NCR.Com>
Date: 1996/05/21
Message-ID: <DrrK9v.C44_at_falcon.daytonoh.attgis.com>#1/1


Thanks for all the suggestions. I've taken pieces from a few and come up with the following solution:

sqlplus -s /nolog _at_runfile.sql

and placing as the first three lines in the runfile.sql:

whenever sqlerror exit rollback
whenever oserror exit rollback
connect /

Now when the connect fails as part of the sql code, the script exits. In my case, the users should have an ops$ login to the database.

Mike
>==========Mike Philippens, 5/17/96==========
>
>Mike Gold <Michael.Gold_at_DaytonOH.NCR.Com> wrote:
>
>>When I execute a UNIX shell, which has a call to SQL*Plus and
>>includes a username/passwrod and an executable SQL file
>>(sqlplus username/login _at_runfile.sql)
>>if the SQL username/password is invalid, and the UNIX script is
>>running in the background; a prompt for a correct username/password is
>>generated by ORACLE, but is never seen. Is there any way to
>>specify on the SQL*Plus command line that if the username/password is
>>invalid, that SQL*Plus should NOT prompt for a valid login? In
>>this case, I want the UNIX shell to continue processing, reguardless
>>of whether or not the SQL file processed.
>
>I'm doing this out of my head, but isn't there an option in SQL*Plus
>'WHENEVER SQLERROR CONTINUE or EXIT'. You should look in the manual
>for this. I don't know if this only works for SQL statements, but it's
>worth a try.
>
>
Received on Tue May 21 1996 - 00:00:00 CEST

Original text of this message