i have question(s) about proper usage of some functions that are mentioned in the
doc/sql.extensions/README.packages.txt:
The following expressions are valid only if all operands are constants:
...
6) ... IIF ...
So, i run:
set bail on;
set autoterm on;
set list on;
set names utf8;
set echo on;
shell if exist r:\temp\tmp4test.fdb del r:\temp\tmp4test.fdb;
create database 'localhost:r:\temp\tmp4test.fdb' user sysdba password 'masterkey';
create or alter function standalone_abs returns smallint
as
declare foo smallint = iif(3 > 2, 1, 0);
begin
return 1;
end
;
create or alter package pg_const as
begin
constant bar smallint = iif(3 > 2, 1, 0);
end
;
-- and get:
Statement failed, SQLSTATE = 42000
CREATE OR ALTER PACKAGE "PUBLIC"."PG_CONST" failed
-The constant "PUBLIC"."PG_CONST"."BAR" must be initialized by a constant expression
Is it expected ?