DROP PROCEDURE test_types3
ORA-04043: object TEST_TYPES3 does not existMore Details: https://docs.oracle.com/error-help/db/ora-04043
DROP TYPE type15_subtype
Type dropped.
DROP TYPE type15_basetype
Type dropped.
Enable the Deprecation Warnings
ALTER SESSION SET PLSQL_WARNINGS='ENABLE:(6019,6020,6021,6022)'
Statement processed.
CREATE OR REPLACE TYPE type15_basetype AS OBJECT
(
x1 NUMBER,
x NUMBER,
PRAGMA DEPRECATE (x),
MEMBER PROCEDURE f0 ,
PRAGMA DEPRECATE (f0),
MEMBER PROCEDURE f1 ,
PRAGMA DEPRECATE (f1),
MEMBER PROCEDURE f2 ,
PRAGMA DEPRECATE (f2),
MEMBER PROCEDURE f3 ) NOT FINAL;
Warning: TYPE TYPE15_BASETYPE Line: 5 PLW-06019: entity X is deprecated Line: 7 PLW-06019: entity F0 is deprecated Line: 9 PLW-06019: entity F1 is deprecated Line: 11 PLW-06019: entity F2 is deprecatedMore Details: https://docs.oracle.com/error-help/db/ora-20001
CREATE OR REPLACE TYPE BODY type15_basetype AS
MEMBER PROCEDURE f0
IS
BEGIN
x := 1;
END;
MEMBER PROCEDURE f1
IS
BEGIN
x := 1;
END;
MEMBER PROCEDURE f2
IS
BEGIN
x := 1;
END;
MEMBER PROCEDURE f3
IS
BEGIN
x := 1;
END;
END;
Type created.
CREATE OR REPLACE TYPE type15_subtype UNDER type15_basetype (
y NUMBER ,
MEMBER PROCEDURE f1(z NUMBER),
MEMBER PROCEDURE f1(z NUMBER , m1 NUMBER),
PRAGMA DEPRECATE(f1),
OVERRIDING MEMBER PROCEDURE f2
);
Warning: TYPE TYPE15_SUBTYPE Line: 5 PLW-06019: entity F1 is deprecatedMore Details: https://docs.oracle.com/error-help/db/ora-20001
CREATE TYPE BODY type15_subtype AS
MEMBER PROCEDURE f1(z NUMBER)
IS
BEGIN
-- deprecation attribute inherited in derived type.
x := 1;
x1:= 2;
SELF.f0;
END;
MEMBER PROCEDURE f1(z NUMBER ,
m1 NUMBER)
IS
BEGIN
NULL;
END;
OVERRIDING MEMBER PROCEDURE f2
IS
BEGIN
/* refer to deprecated f2 in super type */
(SELF AS type15_basetype).f2;
/* No warning for a reference to a not deprecated data member in the supertype */
x1 := 1;
END;
END;
Type created.
CREATE OR REPLACE PROCEDURE test_types3
AS
e type15_subtype ;
d type15_basetype ;
BEGIN
e := type15_subtype (1 ,1 ,1);
d := type15_basetype (1, 1);
d.x := 2; -- warning issued
d.f1; -- warning issued
e.f1 (4); -- overloaded in derived type. no warning. not deprecated in the derived type.
e.f1 (1); -- no warning
e.f0; -- f0 is deprecated in base type. deprecation is inherited. warning issued
-- warning issued for deprecated x in d.x and e.x
DBMS_OUTPUT.PUT_LINE(to_char(e.x) || to_char(' ') || to_char(d.x));
END;
Warning: PROCEDURE TEST_TYPES3 Line: 8 PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] Line: 9 PLW-06020: reference to a deprecated entity: F1 declared in unit TYPE15_BASETYPE[8,20] Line: 12 PLW-06020: reference to a deprecated entity: F0 declared in unit TYPE15_BASETYPE[6,20] Line: 15 PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] Line: 15 PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3]More Details: https://docs.oracle.com/error-help/db/ora-20001
SELECT * FROM USER_ERRORS
NAME | TYPE | SEQUENCE | LINE | POSITION | TEXT | ATTRIBUTE | MESSAGE_NUMBER | OBJDATA | TYPE | 1 | 6 | 4 | PLW-06019: entity ADD2 is deprecated | WARNING | 6019 | TYPE15_BASETYPE | TYPE | 2 | 7 | 3 | PLW-06019: entity F0 is deprecated | WARNING | 6019 | TYPE15_BASETYPE | TYPE | 3 | 9 | 3 | PLW-06019: entity F1 is deprecated | WARNING | 6019 | TYPE15_BASETYPE | TYPE | 4 | 11 | 3 | PLW-06019: entity F2 is deprecated | WARNING | 6019 | TYPE15_BASETYPE | TYPE BODY | 1 | 20 | 3 | PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] | WARNING | 6020 | TYPE15_SUBTYPE | TYPE | 1 | 5 | 3 | PLW-06019: entity F1 is deprecated | WARNING | 6019 | TYPE15_SUBTYPE | TYPE BODY | 1 | 6 | 3 | PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] | WARNING | 6020 | TYPE15_SUBTYPE | TYPE BODY | 2 | 8 | 3 | PLW-06020: reference to a deprecated entity: F0 declared in unit TYPE15_BASETYPE[6,20] | WARNING | 6020 | TYPE15_SUBTYPE | TYPE BODY | 3 | 20 | 3 | PLW-06020: reference to a deprecated entity: F2 declared in unit TYPE15_BASETYPE[10,20] | WARNING | 6020 | TEST_TYPES3 | PROCEDURE | 1 | 8 | 5 | PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] | WARNING | 6020 | TYPE15_BASETYPE | TYPE | 1 | 5 | 3 | PLW-06019: entity X is deprecated | WARNING | 6019 | TEST_TYPES3 | PROCEDURE | 2 | 9 | 3 | PLW-06020: reference to a deprecated entity: F1 declared in unit TYPE15_BASETYPE[8,20] | WARNING | 6020 | TEST_TYPES3 | PROCEDURE | 3 | 12 | 3 | PLW-06020: reference to a deprecated entity: F0 declared in unit TYPE15_BASETYPE[6,20] | WARNING | 6020 | TEST_TYPES3 | PROCEDURE | 4 | 15 | 34 | PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] | WARNING | 6020 | TEST_TYPES3 | PROCEDURE | 5 | 15 | 66 | PLW-06020: reference to a deprecated entity: X declared in unit TYPE15_BASETYPE[4,3] | WARNING | 6020 |
---|