Check $$PLSQL_OPTIMIZE_LEVEL : PLSQL_OPTIMIZE_LEVEL « SQL PLUS Session Environment « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE OR REPLACE PROCEDURE post_processed
  2  IS
  3  BEGIN
  4  $IF $$PLSQL_OPTIMIZE_LEVEL = 1
  5  $THEN
  6     -- Slow and easy
  7     NULL;
  8  $ELSE
  9     -- Fast and modern and easy
 10     NULL;
 11  $END
 12  END post_processed;
 13  /

Procedure created.

SQL>
SQL> DECLARE
  2     l_postproc_code   dbms_preprocessor.source_lines_t;
  3     l_row             PLS_INTEGER;
  4  BEGIN
  5     l_postproc_code := dbms_preprocessor.get_post_processed_source ('PROCEDURE', USER, 'POST_PROCESSED');
  6     l_row := l_postproc_code.FIRST;
  7
  8     WHILE (l_row IS NOT NULL)
  9     LOOP
 10        DBMS_OUTPUT.put_line (LPAD (l_row, 3)|| ' - '|| rtrim ( l_postproc_code (l_row),chr(10)));
 11        l_row := l_postproc_code.NEXT (l_row);
 12     END LOOP;
 13
 14  END;
 15  /

PL/SQL procedure successfully completed.








29.48.PLSQL_OPTIMIZE_LEVEL
29.48.1.Check $$PLSQL_OPTIMIZE_LEVEL
29.48.2.$IF $$plsql_optimize_level
29.48.3.$IF $$plsql_optimize_level IS NULL OR $$plsql_optimize_level IS NOT NULL