A script-enabled browser is required for this page to function properly.

TOOL_ERR.CODE built-in function

This function returns the error code for the ith error on the error stack (the default is the top-most error). If there are no errors on the stack, zero is returned.

Syntax


FUNCTION TOOL_ERR.CODE
(i PLS_INTEGER := TOPERROR)
RETURN NUMBER;

Parameters

Parameter

Description

i

An integer that specifies an error on the error stack.

Returns

The error code of the error specified.

Example


 /*
  ** Check for unexpected error, disregard it,
  ** and print any other error.
 */
  PROCEDURE check_err IS 
   BEGIN
     IF (TOOL_ERR.CODE != PKG_A.NOT_FOUND) THEN 
     TEXT_IO.PUT_LINE(TOOL_ERR.MESSAGE);
   END IF; 
  TOOL_ERR.POP;
END; 

See also

About the TOOL_ERR built-in package

TOOL_ERR built-in package