"F. Biguet" <fb*****@yahoo. fr> wrote in message
news:c2******** *************** ***@posting.goo gle.com...
Hello,
I want to create a generic script that connects to Oracle databases
(from 7.3.4 to 9.2 version) with a guest user. This script should
return 1 if connection is successful and 0 if not.
My problem is due to the 3 requests for password when the connection
fails. I can't find any option that allows to ask for password only
one time.
Has anyone already written a such script?
Thank you in advance.
Fanny
You know that 7.3.4 is pre-historic and unsupported for years don't you?
I don't know what you exactly like to achieve but this might give you a
hint.
0 = success
1 = failure
Can't remember if "whenever sqlerror exit failure" exists in 7.3.4
== test.sql
myserver{oracle }# cat test.sql
whenever sqlerror exit failure
connect &1/&2@&3
exit
==
== Connect error ===
myserver{oracle }#sqlplus /nolog @test bla bla mydb
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Sep 14 15:38:00 2004
(c) Copyright 2000 Oracle Corporation. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
myserver{oracle }# echo $?
1
==
== Connect succeeds
myserver{oracle }# sqlplus /nolog @test system manager mydb
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Sep 14 15:38:15 2004
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected.
Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production
dtodbs1{oracle} # echo $?
0
==
Regards,
Rob