SYS_MGR.DBMS_ERRORCODE

How to:

The SYS_MGR.DBMS_ERRORCODE command enables you to retrieve error codes returned by the DBMS server and then take appropriate action. For example, a developer might want to take a different course of action for an INSERT that fails because the user does not have INSERT rights versus a referential integrity failure.

Note:

Syntax: How to Use SYS_MGR.DBMS_ERRORCODE

The syntax is

SYS_MGR.DBMS_ERRORCODE ;

Example: Retrieving an Error Code From a DBMS

For example, the following Maintain code will retrieve an error code from a DBMS, and if it is a specific code, branches to some appropriate code:

Compute ErrCode/a3 = SYS_MGR.DBMS_ERRORCODE ;
If ErrCode EQ '515' goto BadInsert;