Package gb_common_strings This package contains the error messages and error message functions for the COMMON API (gb_common).These messages are returned as exceptions from various GB_COMMON functions and procedures.
|
Program units |
f_append_error | Appends an error message string to an existing string |
f_get_error | Returns the error message corresponding to an error message key value defined in the strings gb_common_strings package. |
f_get_error_with_value | This function is used to insert data values into an error message so that the resulting error message is specific to the data in question. |
Types |
err_type | This TYPE definition is used to declare API error message strings. |
errmsg_tab_type | The declaration for an API error message type table. |
Variables |
error_tab | This PL/SQL table definition is used by each of the Banner Common APIs to hold error message strings for the Common strings package. |
Constants |
ERR_CODE | This is the exception number used to raise all API exceptions. |
OPTIMISTIC_LOCK_EXCEPTION | This is the exception number used to raise for the optimistic locking exceptions. |
ERR_DELIMITER | When multiple API errors are reported, this is the delimiter used to separate each. |
ERR_SEPARATOR | This is the string used to substitute for the ERR_DELIMITER when error messages are formatted for output. |
ERR_LENGTH | This is the maximum length of error messages. |
ERR_CODE
ERR_CODE CONSTANT NUMBER := -20100;
This is the exception number used to raise all API exceptions.
OPTIMISTIC_LOCK_EXCEPTION
OPTIMISTIC_LOCK_EXCEPTION CONSTANT NUMBER := -20101;
This is the exception number used to raise for the optimistic locking exceptions.
ERR_DELIMITER
ERR_DELIMITER CONSTANT VARCHAR2(2) := '::';
When multiple API errors are reported, this is the delimiter used to separate each.
ERR_SEPARATOR
ERR_SEPARATOR CONSTANT VARCHAR2(2) := ' ';
This is the string used to substitute for the ERR_DELIMITER when error messages are formatted for output.
ERR_LENGTH
ERR_LENGTH CONSTANT PLS_INTEGER := 4000;
This is the maximum length of error messages.
err_type
SUBTYPE err_type IS VARCHAR2 (4000);
This TYPE definition is used to declare API error message strings.
errmsg_tab_type
TYPE errmsg_tab_type IS TABLE OF err_type INDEX BY VARCHAR2(30);
The declaration for an API error message type table.
Used by the APIs to define the structure to hold their API specific error message strings.
error_tab
error_tab gb_common_strings.errmsg_tab_type;
This PL/SQL table definition is used by each of the Banner Common APIs to hold error message strings for the Common strings package.
f_append_error
FUNCTION f_append_error(p_original_message VARCHAR2, p_error_message VARCHAR2) RETURN VARCHAR2
Appends an error message string to an existing string
The messages are separated by gb_common_strings.ERR_DELIMITER.
If the resulting string will be longer than gb_common_strings.ERR_LENGTH, it simply returns the original error message unchanged. If it will fit, it calls f_err_msg_add_delim and concatenates the result to the original message.
Parameters |
p_original_message |
The string to which the delimited p_error_message is to be appended. | |
p_error_message |
The string to append to the end of p_original_message. VARCHAR2. |
Returns |
p_original_message with p_error_message concatenated onto the end with appropriate delimiters. |
f_get_error
FUNCTION f_get_error(p_errorname VARCHAR2) RETURN VARCHAR2
Returns the error message corresponding to an error message key value defined in the strings gb_common_strings package.
Parameters |
p_errorname |
Name associated with error message. |
f_get_error_with_value
FUNCTION f_get_error_with_value(p_package VARCHAR2, p_errorname VARCHAR2, p_value01 IN VARCHAR2 DEFAULT NULL, p_value02 IN VARCHAR2 DEFAULT NULL, p_value03 IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2
This function is used to insert data values into an error message so that the resulting error message is specific to the data in question.
For example, rather than returning 'Invalid Address Type', the application may want to return 'Invalid Address Type MA'. However, the data value cannot simply be appended to the end of the message, as this may not be the appropriate place in all languages.
To accomplish this, error messages may be defined with up to 3 placeholders,
%01% , %02% , %03%, that will be positioned to accept the data values.
This function then takes the error string and up to 3 values, and substitutes them in order into the places held by the placeholders. If no values are passed, the placeholders a simply removed.
Parameters |
p_package_name |
The name of the package in which the error is defined. | |
p_error_name |
The error key that locates the error message in the APIs strings package error message table. | |
p_value01 |
The first data value to insert into the error string. | |
p_value02 |
The second data value to insert into the error string. | |
p_value03 |
The third data value to insert into the error string. |
Returns |
The error message string with the data values inserted into it at the appropriate places. |