Focal Point
[CLOSED]How to obtain an Oracle error code?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6527012976

November 05, 2015, 04:20 AM
Wep5622
[CLOSED]How to obtain an Oracle error code?
One of our database servers is having issues with some regularity outside of our control, in which case I'd prefer to be able to present our users with a proper error message (instead of the "text dump" they get now), but only for that specific case.

Normally I'd look at &FOCERRNUM, but the original error gets overwritten in the process with more generic error codes, so it's less than useless for this purpose.

The sequence of errors that I'm looking into is:
 (FOC1400) SQLCODE IS 257 (HEX: 00000101)
 (FOC1394) CONNECT FAILURE
 : ORA-00257: archiver error. Connect internal only, until freed.
 L    (FOC1405) SQL PREPARE ERROR.
 0 ERROR AT OR NEAR LINE    208  IN PROCEDURE foobar_bla_bla_yarrrr_matey
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT


I would prefer to obtain the actual ORA-00257 code, at the end of the entire procedure (which is where our error-checking code resides), so that I can display a proper message like "The database that this report depends on has shut down due to a technical issue. Contact the administrator to get it fixed." (or: "Don't call us, we're not the people who can fix this").
Is that possible?

If not, is it possible in some way to walk back through &FOCERRNUM codes until something of relevance can be found (which requires that &FOCERRNUM is the top-item of a stack of some sort)?

How do other people tackle this beast in a generic way? I know that this is supposed to be a real rare issue, but today is the third time in a month or so.

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 05, 2015, 08:05 AM
Ricardo Augusto
&RETCODE?

Take a look here http://infocenter.informationb...source%2Ftopic62.htm

This message has been edited. Last edited by: Ricardo Augusto,


WebFOCUS 8.1.05 / APP Studio
November 05, 2015, 08:55 AM
Wep5622
Does &RETCODE get set (to anything useful) for a TABLE request that fails due to a database server error? Or perhaps you read 'procedure' as to mean an 'Oracle stored procedure'?

I am looking at obtaining the ORA error code at the end of our FOCUS procedures. Those contain either TABLE requests or passthru SQL to the database server, that break with the above mentioned sequence of errors when the server is down.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 05, 2015, 09:29 AM
Tom Flynn
&RETCODE, &IORETURN AND &FOCERRNUM ARE WebFOCUS amperes that capture error codes on the "WebFOCUS side", even though IBI captures the message from the DB(if you figure out how IBI does it, then, that would be good, we've not gotten it to work).
Might try SQLERRM function on the DB side and bang it out to a file.
You probably have already done this, but, lots on this subject if you Google search "capture oracle error code"


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe