Enable the Deprecation Warnings
ALTER SESSION SET PLSQL_WARNINGS='ENABLE:(6019,6020,6021,6022)'
Statement processed.
Check warning setting
SELECT DBMS_WARNING.get_warning_setting_string() FROM DUAL
DBMS_WARNING.GET_WARNING_SETTING_STRING() | DISABLE:ALL,ENABLE: 6019,ENABLE: 6020,ENABLE: 6021,ENABLE: 6022 |
---|
CREATE OR REPLACE PACKAGE pack1 AS
PRAGMA DEPRECATE(pack1);
PROCEDURE foo;
PROCEDURE bar;
END pack1;
Warning: PACKAGE PACK1 Line: 2 PLW-06019: entity PACK1 is deprecatedMore Details: https://docs.oracle.com/error-help/db/ora-20001
CREATE OR REPLACE PACKAGE BODY pack1 AS
PROCEDURE foo AS
BEGIN
DBMS_OUTPUT.PUT_LINE('Executing foo.');
END foo;
PROCEDURE bar IS
BEGIN
DBMS_OUTPUT.PUT_LINE('bar references foo inside the same package.');
foo;
END bar;
END;
Package Body created.
EXEC pack1.bar
bar references foo inside the same package.
Executing foo.
CREATE OR REPLACE PROCEDURE proc2 AS
BEGIN
pack1.foo;
END proc2;
Warning: PROCEDURE PROC2 Line: 3 PLW-06020: reference to a deprecated entity: PACK1 declared in unit PACK1[1,9]More Details: https://docs.oracle.com/error-help/db/ora-20001
Display compilation warnings
SELECT * FROM USER_ERRORS
NAME | TYPE | SEQUENCE | LINE | POSITION | TEXT | ATTRIBUTE | MESSAGE_NUMBER | PROC2 | PROCEDURE | 1 | 3 | 8 | PLW-06020: reference to a deprecated entity: PACK1 declared in unit PACK1[1,9] | WARNING | 6020 | PACK1 | PACKAGE | 1 | 2 | 1 | PLW-06019: entity PACK1 is deprecated | WARNING | 6019 |
---|