Home » SQL & PL/SQL » SQL & PL/SQL » SQLCODE, SQLERM
SQLCODE, SQLERM [message #2867] Mon, 19 August 2002 04:24 Go to next message
Mike Nibeck
Messages: 49
Registered: May 2002
Member
Simple expection block, with the following:

EXCEPTION
WHEN others THEN
ErrCode := SQLCODE;
ErrMesg := SQLERRM;

When this block gets called becuase of a NO_DATA_FOUND excpetion, we get the follwing return values for SQLCODE and SQLERRM:

Code = 100
Msg = ORA-01403: no data found

Why isn't the Code value 01403? Is there any signifigance to the 100 number? Should we even be check the Code value, or simply looking at the Msg value?

_mike
Re: SQLCODE, SQLERM [message #2879 is a reply to message #2867] Mon, 19 August 2002 09:45 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
The no_data_found exception is the only, well, exception. From the docs:

For internal exceptions, SQLCODE returns the number of the associated Oracle error.

The number that SQLCODE returns is negative unless the Oracle error is no data found, in which case SQLCODE returns +100.


So, you can look at the SQLCODE value, but just plan on the fact that you will see 100 there for this particular exception.
Previous Topic: Find duplicate record help
Next Topic: Returning multiple records in a sp
Goto Forum:
  


Current Time: Fri Apr 26 01:12:52 CDT 2024