TOOL_ERR.ENCODE
built-in functionThis function, given a prefix and an offset, constructs a unique error code for use within a package.
Note:This is not a PL/SQL exception.
FUNCTION TOOL_ERR.ENCODE
(prefix VARCHAR2,
offset PLS_INTEGER)
RETURN NUMBER;
Parameter |
Description |
|
A string of five characters. |
|
An integer from 1 to 127. |
An error code.
/*
** 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;
About the TOOL_ERR
built-in package
Copyright © 1984, 2005, Oracle. All rights reserved.