CREATE OR REPLACE PROCEDURE proc1
IS
BEGIN
DBMS_OUTPUT.put_line ('Program Unit = ' || $$plsql_unit);
END;
Procedure created.
BEGIN
proc1 ();
END;
Program Unit = PROC1
CREATE OR REPLACE PACKAGE pkg
IS
PROCEDURE proc;
END;
Package created.
CREATE OR REPLACE PACKAGE BODY pkg
IS
PROCEDURE proc
IS
BEGIN
DBMS_OUTPUT.put_line ('Program Unit = ' || $$plsql_unit);
END;
END;
Package Body created.
BEGIN
pkg.proc ();
END;
Program Unit = PKG
CREATE OR REPLACE PROCEDURE proc2
IS
PROCEDURE proc_nested
IS
BEGIN
DBMS_OUTPUT.put_line ('Program Unit = ' || $$plsql_unit);
END;
BEGIN
proc_nested;
END;
Procedure created.
BEGIN
proc2 ();
END;
Program Unit = PROC2
CREATE OR REPLACE TYPE an_object_type IS OBJECT
(
n NUMBER,
STATIC PROCEDURE proc_method
)
Type created.
CREATE OR REPLACE TYPE BODY an_object_type
IS
STATIC PROCEDURE proc_method
IS
BEGIN
DBMS_OUTPUT.put_line ('Program Unit = ' || $$plsql_unit);
END;
END;
Type created.
BEGIN
an_object_type.proc_method ();
END;
Program Unit = AN_OBJECT_TYPE
CREATE OR REPLACE PROCEDURE proc3
IS
BEGIN
EXECUTE IMMEDIATE 'begin proc1; end;';
END;
Procedure created.
BEGIN
proc3;
END;
Program Unit = PROC1
DROP PROCEDURE proc1
Procedure dropped.
DROP PROCEDURE proc2
Procedure dropped.
DROP PROCEDURE proc3
Procedure dropped.
DROP PACKAGE pkg
Package dropped.
DROP TYPE an_object_type
Type dropped.