Oracle Inquiry Directives and Compilation Parameters 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
Predefined Inquiry Directives act like built-in functions, but are not objects such as can be found in DBA_OBJECTS that return values related to compiled PL/SQL objects.
The Inquiry Directives are of great value in creating robust debugging and error handling routines.
Some of the code samples on this page relate to PL/SCOPE ... click on the link at the bottom of this page to view additional information and code examples with PL/SCOPE.
Predefined Inquiry Directives
$$PLSQL_LINE
set serveroutput on
BEGIN
NULL;
NULL;
NULL;
dbms_output.put_line($$plsql_line);
END;
/
$$PLSQL_UNIT
CREATE OR REPLACE PROCEDURE test AUTHID DEFINER IS
BEGIN
dbms_output.put_line('I am ' || $$plsql_unit);
END test;
/
set serveroutput on
exec test
$$PLSQL_UNIT_OWNER
CREATE OR REPLACE PROCEDURE test AUTHID DEFINER IS
BEGIN
dbms_output.put_line('I am owned by ' || $$plsql_unit_owner);
END test;
/
set serveroutput on
exec test
$$PLSQL_UNIT_TYPE
CREATE OR REPLACE PROCEDURE test AUTHID DEFINER IS
BEGIN
dbms_output.put_line('I am a ' || $$plsql_unit_type);
END test;
/
set serveroutput on
exec test
Assigning Values to Inquiry Directives
Demo
ALTER SESSION SET PLSQL_CCFlags = 'UW_Flag:1, Some_Flag:2, PLSQL_CCFlags:42';
set serveroutput on
BEGIN
dbms_output.put_line($$UW_Flag);
dbms_output.put_line($$Some_Flag);
dbms_output.put_line($$PLSQL_CCFlags);
END;
/