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

TOOL_ERR.Code

Description

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;