We continue this series of blogs on New Features for Developers with some updated conditional compilation features.
Oracle10 introduced conditional compilation, or the ability to compile PL/SQL lines of code depending on the database version being compiled on. I blogged on this topic originally back in November, 2014 (boy…I’ve been blogging for a while!).
Of course you would expect the ver_le_12 business (where you can check for the major and minor release numbers) but Oracle has added the ability to tell programmers at compile time that there has been some kind of change implemented.
The example Oracle employee Chris Saxon used was a coding change where one routine had been deprecated and another was to be used in its place.
Using a pragma clause in the package specifications (CREATE or REPLACE PACKAGE), the compiler will throw errors or warnings if the old routine is still being called.
PRAGMA DEPRECATE(get_ename_upper,’Use get_ename instead’);
ALTER SYSTEM SET PLSQL_WARNINGS = ‘error: (6019,6020,6021,6022);
The 6020 error is ‘reference to a deprecated entity’. This pragma clause will cause anything being compiled that references the ‘get_ename_upper’ to be flagged.
Oracle News on Oracle12.2 on-premise versions release date: Oracle VP Tirthankar Lahiri says , “Oracle is presenting features for Oracle database 12c Release 2 on Oracle cloud. Features and enhancements related to the on-premises versions of Oracle Database 12c Release 2 are not being announced at this time”.
Oracle ACE Director