The PRINT_POST_PROCESSED_SOURCE procedure is used to print the PL source code after conditional compilation processing.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
The PRINT_POST_PROCESSED_SOURCE procedure supports the following three overloaded forms:
Obtain by object type, schema name, and object name
DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE(
object_type VARCHAR2,
schema_name VARCHAR2,
object_name VARCHAR2);
Obtain by source code string
DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE(
source VARCHAR2);
Obtain by source code collection
DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE(
source source_lines_t);
Parameters
Parameter |
Description |
|---|---|
| object_type | The type of PL object to process. Supported types include: PACKAGE, PACKAGE BODY, PROCEDURE, FUNCTION, TRIGGER, TYPE, and TYPE BODY. |
| schema_name | The name of the schema to which the object belongs. If NULL, the current schema is used. |
| object_name | The name of the object. |
| source | A PL source code string or a source_lines_t collection. |
Usage notes
- The
PRINT_POST_PROCESSED_SOURCEprocedure calls theGET_POST_PROCESSED_SOURCEfunction to obtain the post-processed source code and then prints it line by line usingDBMS_OUTPUT.PUT_LINE. - When using the overloaded form by object type, schema name, and object name, ensure that the specified object exists in the database and the type matches.
- The overloaded form by source code collection is not currently supported.
Example
DECLARE
source VARCHAR2(32767);
BEGIN
source := 'CREATE OR REPLACE PACKAGE my_pkg IS
$IF DBMS_DB_VERSION.VER_LE_21 $THEN
SUBTYPE my_type IS NUMBER;
$ELSE
SUBTYPE my_type IS VARCHAR2(100);
$END
PROCEDURE p;
END;';
DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE(source);
END;
/
