DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_DB_VERSION

Source


1 package dbms_db_version is
2   version constant pls_integer := 12; -- RDBMS version number
3   release constant pls_integer := 1;  -- RDBMS release number
4 
5   /* The following boolean constants follow a naming convention. Each
6      constant gives a name for a boolean expression. For example,
7      ver_le_9_1  represents version <=  9 and release <= 1
8      ver_le_10_2 represents version <= 10 and release <= 2
9      ver_le_10   represents version <= 10
10 
11      A typical usage of these boolean constants is
12 
13          $if dbms_db_version.ver_le_10 $then
14            version 10 and ealier code
15          $elsif dbms_db_version.ver_le_11 $then
16            version 11 code
17          $else
18            version 12 and later code
19          $end
20 
21      This code structure will protect any reference to the code
22      for version 12. It also prevents the controlling package
23      constant dbms_db_version.ver_le_11 from being referenced
24      when the program is compiled under version 10. A similar
25      observation applies to version 11. This scheme works even
26      though the static constant ver_le_11 is not defined in
27      version 10 database because conditional compilation protects
28      the $elsif from evaluation if the dbms_db_version.ver_le_10 is
29      TRUE.
30   */
31 
32   ver_le_9_1    constant boolean := FALSE;
33   ver_le_9_2    constant boolean := FALSE;
34   ver_le_9      constant boolean := FALSE;
35   ver_le_10_1   constant boolean := FALSE;
36   ver_le_10_2   constant boolean := FALSE;
37   ver_le_10     constant boolean := FALSE;
38   ver_le_11_1   constant boolean := FALSE;
39   ver_le_11_2   constant boolean := FALSE;
40   ver_le_11     constant boolean := FALSE;
41   ver_le_12_1   constant boolean := TRUE;
42   ver_le_12     constant boolean := TRUE;
43 
44 end dbms_db_version;