Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Using SQLERROR to test if connected

Using SQLERROR to test if connected

From: Nick Ashley <Nick.Ashley_at_ait.co.uk>
Date: Thu, 2 Sep 1999 14:54:07 +0100
Message-ID: <69B518AF2494D211B26A00805FA76F7854D598@ait-henleyx.ait.co.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US