Re: Is there a table containing ORACLE error codes?

From: craig sivils <casivils_at_lescsse.jsc.nasa.gov>
Date: 18 Mar 93 18:55:47 GMT
Message-ID: <casivils.732480947_at_node_508ba>


In <ALAW.93Mar17223315_at_ap221sun.oracle.com> alaw_at_oracle.com (Alvin W. Law) writes:

>andrew_at_cnw01.storesys.coles.oz.au (Andrew May) writes:
 

>>In <1nq7vnINNnp6_at_ef2007.efhd.ford.com> wwm_at_ef5003.efhd.ford.com (Bill Meahan) writes:

>>>Is there a table in ORACLE (or some other mechanism) by which a user
>>>program could get the short description of an ORACLE error given the
>>>error code number?
 

>>>That is, if I get an error of 1401 (or 01401) is there some way I can
>>>obtain the short description:
>>> Inserted value to large for column
>>>without resorting to the ORACLE Error Messages and Codes Manual?
 

>>>I'd like to provide something meaningful to my users.
 

>>>Note: I am NOT using SQL*Forms (and will not convert my client/server
>>>applications to SQL*Forms).
 

>>Bill,
>> I assume when you say "user program" that you are using one of the
>>Oracle programmatic interfaces such as Pro*Cobol.
 

>>If you are using Pro*cobol, you include the sqlca library. This includes
>>a variable called SQLCODE which is the Oracle error code returned (e.g. 1401)
>>and SQLERRMC which is the text of the error. I would expect all the
>>supported 3gl's to have a similar include file.
 

>SQLCA.SQLERRM.SQLERRMC only stores the error message as recorded in
>SQLCA. If you call a stored procedure through embedded PL/SQL, you
>can trap a sqlerror inside your procedure and passes the calling
>module the sqlcode using a bind variable without SQLCA
>knowing anything about the sqlerror occured inside the stored
>procedure. In this case, it would be necessary for a function /
>lookup table for the error message text.

If you are in PL/SQL then the last error that occured is stored in the pseudo variable SQLCODE, the associated error message is in SQLERRM. These variables are described in the PL/SQL manual v1.0 page 5-54 to 5-55.

                               Craig
Received on Thu Mar 18 1993 - 19:55:47 CET

Original text of this message