Conditional Compilation : DBMS_DB_VERSION « System Packages « Oracle PL/SQL Tutorial






SQL>
SQL> SET SERVEROUTPUT ON PAGES 9999
SQL>
SQL> CREATE OR REPLACE PROCEDURE compile_by_version
  2  IS
  3
  4  BEGIN
  5     $IF DBMS_DB_VERSION.VER_LE_10_2
  6     $THEN
  7        DBMS_OUTPUT.PUT_LINE('10.2 and under');
  8     $ELSIF DBMS_DB_VERSION.VER_LE_10_1
  9     $THEN
 10        DBMS_OUTPUT.PUT_LINE('10.1 and under');
 11     $ELSE
 12        DBMS_OUTPUT.PUT_LINE('Not 10g');
 13     $END
 14
 15  END;
 16  /

Procedure created.








31.6.DBMS_DB_VERSION
31.6.1.Conditional Compilation