ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Purpose
Provides an interface to print or retrieve the source text of a PL/SQL unit in its post-processed form
AUTHID
CURRENT_USER
Data Types
TYPE source_lines_t IS TABLE OF VARCHAR2(32767)
INDEX BY BINARY_INTEGER;
dbms_preprocessor.get_post_processed_source (
object_type IN VARCHAR2,
schema_name IN VARCHAR2,
object_name IN VARCHAR2)
RETURN source_lines_t;
CREATE OR REPLACE FUNCTION uwclass.test_func RETURN NUMBER
AUTHID DEFINER IS
i user_tables.blocks%TYPE := 1;
BEGIN
-- my demo comment in the code
i := i + 1;
RETURN i;
END test_func;
/
set serveroutput on
DECLARE
retval_t dbms_preprocessor.source_lines_t;
BEGIN
retval_t := dbms_preprocessor.get_post_processed_source(
'FUNCTION', 'UWCLASS', 'TEST_FUNC');
FOR i IN 1..retval_t.LAST
LOOP
dbms_output.put_line(retval_t(i));
END LOOP;
END;
/ FUNCTION uwclass.test_func RETURN NUMBER AUTHID
DEFINER IS
i user_tables.blocks%TYPE := 1;
BEGIN
-- my demo comment in the code
i := i + 1;
RETURN i;
END test_func;
PL/SQL procedure successfully completed.
Overload 2
dbms_preprocessor(source IN VARCHAR2) RETURN source_lines_t;
set serveroutput on
DECLARE
instring VARCHAR2(32767);
retval_t dbms_preprocessor.source_lines_t;
BEGIN
instring := 'BEGIN ' ||
' FOR i IN 1 .. 100 LOOP ' ||
' NULL; ' ||
' END LOOP; ' ||
'END;';