Search notes:

PL/SQL: Nested conditional compilation

Preprocessor conditional compilation blocks can be nested:
alter session set plsql_ccflags = 'flag_xyz:true';

create or replace procedure tq84_test_nested_preproc authid definer as
begin

   $if true $then 

      $if $$flag_xyz $then
          dbms_output.put_line('This line is printed if flag xyz is set');
      $else
          dbms_output.put_line('This line is printed if flag xyz is not set');
      $end

   $else

      $if $$flag_xyz $then
          dbms_output.put_line('This line is not printed');
      $else
          dbms_output.put_line('This line is not printed');
      $end

   $end

end tq84_test_nested_preproc;
/

begin
   tq84_test_nested_preproc;
end;
/

alter session set plsql_ccflags = 'flag_xyz:false';
alter procedure tq84_test_nested_preproc compile;

begin
   tq84_test_nested_preproc;
end;
/

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758207104, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/compilation/conditional/nested(71): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78