Oracle UTL_LMS
Version 18.3.0.1

General Information
Library Note Morgan's Library Page Header
For how many years have you been working with physical servers that are starving your database of the memory necessary to deploy important new performance features such as the Result Cache, Memoptimize Pool, In-Memory Aggregation, In-Memory Column Store, and Full Database Caching? Too long? Contact me to learn how to improve all queries ... not just some queries.
Purpose Retrieves and formats error messages in different languages
AUTHID DEFINER
Dependencies
DBMS_GSM_DBADMIN DBMS_SERVER_ALERT ORA12C_STRONG_VERIFY_FUNCTION
DBMS_GSM_POOLADMIN DBMS_UNDO_ADV ORA12C_VERIFY_FUNCTION
DBMS_MACUTL DBMS_WRR_REPORT ORA_COMPLEXITY_CHECK
DBMS_REPORT ORA12C_STIG_VERIFY_FUNCTION UTL_LMS_LIB
Documented Yes
First Available 10.1
Security Model Owned by SYS with EXECUTE granted to PUBLIC and DVSYS
Source {$ORACLE_HOME}/rdbms/admin/utllms.sql
Special Characters
Character Description
'%s' Substitute the next string argument
'%d' Substitute the next integer argument
'%%' Represents the special character %
Subprograms
 
FORMAT_MESSAGE
Formats a retrieved error message utl_lms.format_message(
format IN VARCHAR2 CHARACTER SET ANY_CS,
args   IN ...)
RETURN VARCHAR2 CHARACTER SET format%CHARSET;
set serveroutput on

DECLARE
 s VARCHAR2(32767);
 i PLS_INTEGER;
BEGIN
  i := utl_lms.get_message(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, 96, 'my_string'));
END;
/
 
GET_MESSAGE
Retrieves an error message based on error number, product, facility, language, and message specified 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;
set serveroutput on

DECLARE
 s VARCHAR2(200);
 i PLS_INTEGER;
BEGIN
  i := utl_lms.get_message(601, 'rdbms', 'oci', 'English', s);
  dbms_output.put_line('English: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Spanish', s);
  dbms_output.put_line('Spanish: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Italian', s);
  dbms_output.put_line('Italian: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Dutch', s);
  dbms_output.put_line('Dutch: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'French', s);
  dbms_output.put_line('French: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'German', s);
  dbms_output.put_line('German: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Danish', s);
  dbms_output.put_line('Danish: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Norwegian', s);
  dbms_output.put_line('Norwegian: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Polish', s);
  dbms_output.put_line('Polish: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Swedish', s);
  dbms_output.put_line('Swedish: OCI--00601 is: ' || s);

  i := utl_lms.get_message(601, 'rdbms', 'oci', 'Turkish', s);
  dbms_output.put_line('Turkish: OCI--00601 is: ' || s);
END;
/

Related Topics
Built-in Functions
Built-in Packages
Exception Handling
UTL_GDK
What's New In 12cR2
What's New In 18cR3

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2019 Daniel A. Morgan All Rights Reserved