Search notes:

PL/SQL preprocessor directives within strings

The PL/SQL preprocessor does not parse preprocessor directives if they're located in a string, which can be demonstrated with the following simple procedure:
create or replace procedure tq84_cond_text authid definer as
begin
   dbms_output.put_line(q'[
   $if true $then
      1
   $else
      0
   $end
   ]');
end;
/
When executed, the procedure prints:
SQL> exec tq84_cond_text;
 
   $if true $then
      1
   $else
      0
   $end

Index