Oracle PL/SQL Tutorial/System Packages/DBMS DB VERSION

Материал из SQL эксперт
Перейти к: навигация, поиск

Conditional Compilation

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.