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

TOOL_ERR.Encode

Description

Given a prefix and an offset, constructs a unique error code for use within a package.

Note:  This is not a PL/SQL exception.

Syntax


FUNCTION Tool_Err.Encode
   (prefix VARCHAR2,
    offset PLS_INTEGER)
RETURN NUMBER;

Parameters

Parameter Description
prefix A string of five characters.
offset An integer from 1 to 127.

Returns

An error code.

Example


/*
** Define a list of errors for a package
** called pkg_a.
*/
PACKAGE pkg_a IS 
  not_found CONSTANT pls_integer := TOOL_ERR.ENCODE('pkg_a', 1); 
  bad_value CONSTANT pls_integer := TOOL_ERR.ENCODE('pkg_a', 2); 
  too_big   CONSTANT pls_integer := TOOL_ERR.ENCODE('pkg_a', 3); 
  too_small CONSTANT pls_integer := TOOL_ERR.ENCODE('pkg_a', 4); 
  . . .     /* Rest of pkg_a specification */ 
END;