hanging sql script

Need your help pls...

I have integrated my shell script with sqlplus statements that will fetch necessary data for the rest of the script. As observed, sometimes problems at the oracle database occurs wherein users can not login via sqlplus, so does the script. During execution, the logging of username and password will be rejected and will be asked 3 times before exit. But the script will only login once that is why, the scripts hangs and is unable to continue.

Is there anyway that I can specify so that at logon it will only prompt me once and if error occurs it will exit immediately?

Thanks.

I do not know how to suppress the additional connection attempts. On failure to connect, my batch script will hang when coded like this:

sqlplus scott/tiger @ myscript.sql

But if I use a redirected stdin, it will not hang:

sqlplus scott/tiger << endplus
@ myscript.sql
endplus

i've seen this before...

i'm using bourne shell is it compatible?

for example:

...
sqlplus scott/tiger << endplus
@ myscript.sql
endplus
ls -l
date
... etc.

i mean is this syntax will be compatible if combined with other syntax under bourne shell?

thanks :slight_smile:

Sure, once the "endplus" (or whatever name you choose to assign) closes out the sqlplus, the script will continue with the following commands.

it worked like a charm... thanks