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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQLCODE vs. ORA-nnnnn msgs

Re: SQLCODE vs. ORA-nnnnn msgs

From: Jarl Hermansson <jarl_at_mimer.com>
Date: 9 Dec 2002 06:26:57 -0800
Message-ID: <2aaa8682.0212090626.25719f@posting.google.com>


spamdump_at_nospam.noway.nohow (Ed Stevens) wrote in message news:<3df0fb04.23937510_at_ausnews.austin.ibm.com>...
> Let's try this again, perhaps I can clarify.
>
> When an app issues a SQL statement, various bits of info are returned in a
> memory sturctue usually referred to as the SQLCA area. That area contains a
> numeric SQLCODE and and an alpha SQLERRM. Our apps typically check the SQLCODE
> after each SQL statement. They check for expected values (such as +100 for 'no
> more data') then have a common error routine for 'other'.
>
> We are in the process of converting some cobol apps from DB2/2 to Oracle. We
> know for a fact that some of the specific SQLCODE values being checked don't
> have the same meaning in Oracle as they do in DB2/2. We're looking for a
> reference for those values. Everything and everyone keeps pointing me back to
> the Error Msgs manual, but I'm not finding any reference to specific values or
> SQLCODE.
>
> Is there some way to correlate the value of SQLCODE to the numeric value in
> ORA-nnnnn msgs?
>
> My question is not 'I'm getting this SQLCODE value, what does it mean?" Rather,
> it is "I want to check for this condition, what SQLCODE value should I be
> looking for?"

Can't you use SQLSTATE instead of the deprecated SQLCA/SQLCODE?

SQLSTATE, a 5-character return value specified by the SQL standard, replaced SQLCODE years ago (SQL-92?). Perhaps both Oracle and DB2/2 have support for it.

If you really want to stick to SQLCODE, you could do one list for SQLCODE to SQLSTATE mappings for each DBMS. Then you're half the way translating DB2/2 codes to Oracle codes.

For more info on SQLSTATE, check out:
http://developer.mimer.com/howto/howto_25.htm

Regards,
Jarl Received on Mon Dec 09 2002 - 08:26:57 CST

Original text of this message

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