Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Plus silent mode problem
A technique that I commonly use is to have three blank lines at the top of the script. If the login fails the three blank lines expire the login attempts and sqlplus exits. If the login is successful then they have no effect.
...neil
On Thu, 07 Dec 2000 13:04:32 -0500, Walter T Rejuney <BlueSax_at_Unforgetable.com> wrote:
>carvedude_at_my-deja.com wrote:
>
>> I'm using SQLPlus in silent mode to run a batch script like
>> (sqlplus -s scott/tiger_at_TESTDB @myscript.sql).
>>
>> This works perfect when the database is available. If the database is
>> not available the SQLPlus tries to connect to the database and gets into
>> the SQLPlus prompt for logon information.
>> Does anybody know how to get straight to the exit after the database is
>> not available? Otherwise my script hangs for years!!!
>
>I know of a foolproof method, but it involves writing a small Pro-C or OCI
>program (UNIX) or a VB program with ADO calls (Windows).
>
>Just write a small program that attempts to make the same connection as your
>script and report success or failure. Only if you get success would you
>proceed to call sqlplus.
>
>This is a real weakness in the sqlplus client and Oracle doesn't seem to
>care much about fixing it.
>
Received on Thu Dec 07 2000 - 19:42:47 CST
![]() |
![]() |