On Conditional Compilation
Oracle Database 10g has been groundbreaking when it comes to the world of PL/SQL development, most notably in the evolution of the PL/SQL compiler. In the release 1, the PL/SQL optimizer automatically transforms code so that it can run more efficiently. Oracle estimates that one can expect to see their PL/SQL statements execute, on average, in half the time they took in earlier versions of Oracle Database. The compile-time warnings give feedback on programs that might compile but could be improved. Oracle Database 10g Release 2 takes PL/SQL another big step forward, by adding support for conditional compilation. Conditional compilation can be used to direct the compiler to conditionally include or exclude selected parts of a program. Here, the text that is excluded during conditional compilation need not be legal PL/SQL; this gives flexibility when writing programs that need to work differently in different versions of Oracle Database. To take advantage of conditional compilation, compiler directives are added to the code. The PL/SQL compiler will then evaluate the directives before compilation occurs and determine which parts of your program text cause the generation of executable code. The modified source code is then passed to the compiler for compilation. The selection of the datatype occurs within declaration of the variable. Conditional compilation only to choose between intact, executable statements is unnecessary.