Oracle DBMS_WARNING_INTERNAL
Version 12.1.0.2

General Information
Library Note Morgan's Library Page Header
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.2 to 12.2.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Do you remember when mainframes were replaced by client-server? When client-server was replaced by n-tier architecture? The "Cloud" is a distraction ... DevOps is not. Prepare for the future.
Purpose Internal support package for PL/SQL Warnings and the DBMS_WARNING package
AUTHID CURRENT_USER
Dependencies
ALL_WARNING_SETTINGS USER_WARNING_SETTINGS WARNING_SETTINGS$
DBA_WARNING_SETTINGS    
Documented No
First Available 10.1
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/prvtplsw.plb
 
SHOW_WARNING_SETTING
Undocumented ... and obviously not intended for DBAs and developers dbms_warning_internal(objno IN NUMBER) RETURN PIPELINED warning_setting_coll;
conn uwclass/uwclass@pdbdev

ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';

CREATE OR REPLACE PROCEDURE dead_code AUTHID DEFINER AS
 x NUMBER := 10;
BEGIN
  IF x = 10 THEN
    x := 20;
  ELSE
    x := 100;
  END IF;
END dead_code;
/

SP2-0804: Procedure created with compilation warnings

SELECT plsql_warnings
FROM all_plsql_object_settings
WHERE name = 'DEAD_CODE';

conn sys@pdbdev as sysdba

SQL> SELECT COUNT(*)
  2  FROM dba_warning_settings;

 COUNT(*)
----------
      663

SQL> set linesize 121

SQL> SELECT owner, object_id, object_type
  2  FROM dba_warning_settings
  3  WHERE object_name = 'DEAD_CODE';

OWNER   OBJECT_ID OBJECT_TYPE
------ ---------- -----------
UWCLASS     75140 PROCEDURE

SQL> SELECT dbms_warning_internal.show_warning_settings(75140)
  2  FROM dual;

DBMS_WARNING_INTERNAL.SHOW_WARNING_SETTINGS(71895)(OBJ_NO, WARNING, SETTING, PROPERTY)
--------------------------------------------------------------------------------------
SYS_PLSQL_9DEB8363_32_1(SYS_PLSQL_9DEB8363_9_1(75140, -4, 1, 1))


SQL> SELECT * FROM TABLE(dbms_warning_internal.show_warning_settings(75140));

 OBJ_NO    WARNING SETTING PROPERTY
---------- ------- ------- --------
     75140      -4       1        1

desc dba_warning_settings

SQL> SELECT *
  2  FROM dba_warning_settings
  3  WHERE object_id = 75140;

OWNER   OBJECT_NAME  OBJECT_ID  OBJECT_TYPE  WARNING SETTING
-------- ----------- ---------- ------------ ------- -------
UWCLASS DEAD_CODE    75140      PROCEDURE    ALL     ENABLE

Related Topics
DBMS_WARNING
Packages
PL/SQL Warnings
What's New In 12cR1
What's New In 12cR2

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-2017 Daniel A. Morgan All Rights Reserved