Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Conditional compile in stand alone SELECT

S.BovinFeb 19 2024 — edited Feb 19 2024

Is it possible to use conditions in a standalone SELECT, similar to conditional compile in PL/SQL

I want to run the SELECT in SQL Developer or Toad by itself, not within a PL/SQL block

Something like this -

SELECT
       $IF DBMS_DB_VERSION.VER_LE_18
       $THEN
             DBMS_FOO.Some_Oracle_18_Function
       $ELSE
             DBMS_FOO.Some_Oracle_19_Function
       $END
from blah_blah

The Oracle 19 package function may not exist so it needs to be conditional code that wont be executed if running in an Oracle 18 database

Comments
Post Details
Added on Feb 19 2024
8 comments
159 views