The PRINT_POST_PROCESSED_SOURCE procedure is used to print the PL source code after conditional compilation.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support it.
Syntax
The PRINT_POST_PROCESSED_SOURCE procedure supports the following three overloading forms:
Retrieve 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 from the source code repository
DBMS_PREPROCESSOR.PRINT_POST_PROCESSED_SOURCE(
source source_lines_t);
Parameters
Parameter |
Description |
|---|---|
| object_type | The type of the PL object to be processed. Supported types include:PACKAGE、PACKAGE BODY、PROCEDURE、FUNCTION、TRIGGER、TYPE、TYPE BODY. |
| schema_name | The name of the schema to which the object belongs. If it isNULL, the current schema is used. |
| object_name | Object name. |
| source | PL source code string orsource_lines_tsets. |
Usage instructions
- The
PRINT_POST_PROCESSED_SOURCEprocess calls theGET_POST_PROCESSED_SOURCEfunction to obtain the post-processed source code, and then usesDBMS_OUTPUT.PUT_LINEto print it out line by line. - When using overloaded forms of object types, schema names, or object names, ensure that the specified object exists in the database and its type matches.
- The current version does not support this method through an overloaded form of the source code set.
Examples
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;
/
