PL/SQL Packages and Types Reference 10g Release 1 (10.1) Part Number B10802-01 |
|
|
View PDF |
UTL_LMS
retrieves and formats error messages in different languages.
This chapter contains the following topics:
This package must be created as the user SYS
.
Function | Description |
---|---|
Formats a retrieved error message | |
Retrieves an error message based on error number, product, facility, language, and message specified |
This function formats a message retrieved by the GET_MESSAGE
function and returns the formatted message. If the function fails, then it returns a NULL
result.
The following table shows special characters that can be used in the format string.
Special Character | Description |
---|---|
|
Substitute the next string argument |
|
Substitute the next integer argument |
|
Represents the special character |
UTL_LMS.FORMAT_MESSAGE( format IN VARCHAR2 CHARACTER SET ANY_CS, args IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL) RETURN VARCHAR2 CHARACTER SET format%CHARSET;
Parameter | Description |
---|---|
|
Specifies the string to format |
|
Specifies the list of arguments |
DECLARE s varchar2(200); i pls_integer; BEGIN i:= utl_lms.get_messsage(26052, 'rdbms', 'ora', 'french', s); dbms_output.put_line('before format, message is: '||s); dbms_output.put_line('formatted message is: '||utl_lms.format_message(s, 9, 'my_column_name'); END; /
The following is an unformatted message:
Type %d non pris en charge pour l'expression SQL sur la colonne %s.
The following is the formatted message:
Type 9 non pris en charge pour l'expression SQL sur la colonne my_column_name.
This function retrieves an Oracle error message. The user can define user-specific error messages with the lmsgen
utility.
It returns 0
when it is successful. It returns -1
when it fails.
See Also:
Oracle Database Globalization Support Guide for more information about the |
UTL_LMS.GET_MESSAGE( errnum IN PLS_INTEGER, product IN VARCHAR2, facility IN VARCHAR2, language IN VARCHAR2, message OUT NOCOPY VARCHAR2CHARCTER SET ANY_CS) RETURN PLS_INTEGER;
If the language
parameter is set to NULL
, then the value of the NLS_LANGUAGE
session parameter is used as the default.
DECLARE s varchar2(200); i pls_integer; BEGIN i:=utl_lms.get_message(601, 'rdbms', 'oci', 'french', s); dbms_output.put_line('OCI--00601 is: '||s); END /
The following output results:
OCI--00601 is: Echec du processus de nettoyage.