Search notes:

PLS-00174: a static boolean expression must be used

In the following minimalistic example, the package tq84_compilation_flags is used to provide true/false values for conditional PL/SQL compilation.
create or replace package tq84_compilation_flags authid definer as
 
    verbose boolean := true;
 
end tq84_compilation_flags;
/
tq84_compilation_flags is then used in the «productive» package tq84_xyz:
create or replace package tq84_xyz authid definer as
    procedure run;
end tq84_xyz;
/
 
create or replace package body tq84_xyz as
    procedure run is begin
 
       $if tq84_compilation_flags.verbose $then
           dbms_output.put_line('tq84_xyz.run was called');
       $end
 
       dbms_output.put_line('XYZ was run');
 
    end run;
end tq84_xyz;
/
When trying to compile tq84_xyz, it results in PLS-00174: a static boolean expression must be used.
In tq84_compilation_flags, verbose must be changed to be a constant:
create or replace package tq84_compilation_flags authid definer as
 
    verbose CONSTANT boolean := true;
 
end tq84_compilation_flags;
/

See also

Oracle PL/SQL: Errors and warnings

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...', 1758198823, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/errors-warnings/PLS-00174_a-static-boolean-expression-must-be-used(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78