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.
SQL>
SQL> SELECT TEXT
2 FROM USER_SOURCE
3 WHERE NAME = 'COMPILE_BY_VERSION';
TEXT
------------------------------------------------------------------------------------------------------------------------
PROCEDURE compile_by_version
IS
BEGIN
$IF DBMS_DB_VERSION.VER_LE_10_2
$THEN
DBMS_OUTPUT.PUT_LINE('10.2 and under');
$ELSIF DBMS_DB_VERSION.VER_LE_10_1
$THEN
DBMS_OUTPUT.PUT_LINE('10.1 and under');
$ELSE
DBMS_OUTPUT.PUT_LINE('Not 10g');
$END
END;
15 rows selected.
|