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

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...', 1751413360, '216.73.216.242', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/compilation/conditional/within-string(52): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78