Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Using SQLERROR to test if connected
Hi,
I have recently noticed that the method I've been using to validate passwords passed into SQL scripts run in SQL*Plus does not work on Oracle8 although it worked fine on Oracle7. Here's the method I was using:
/**********************************************************************/
accept INPASS prompt 'Enter SYSTEM password .. : ' hide accept INDB prompt 'Enter host string ........... : ' PROMPT *** Validating passwords ***
REM Attempt the connection and exit thru the SQLERROR if its invalid
connect SYSTEM/&INPASS@&INDB
REM If we are not connected this will fail and exit
whenever sqlerror exit
select null from dual;
whenever sqlerror continue
/**********************************************************************/
On Oracle7, attempting to execute:
SQL> select null from dual;
when not connected produces the following:
ORA-03114: not connected to ORACLE
If exactly the same procedure is followed on Oracle8 the message
returned is just
Not connected
There is no SQL error and so the whenever sqlerror condition doesn't
fire.
Can anyone suggest a reliable method to implement this kind of password validation on Oracle8?
Nick Ashley Received on Thu Sep 02 1999 - 08:54:07 CDT
![]() |
![]() |