Das sollte gehen:
Wird bei uns so eingesetzt
Code:
execute block
returns (
out_name char(31),
out_value bigint)
as
begin
for select rdb$generator_name from rdb$generators where rdb$system_flag is distinct from 1 into out_name do
begin
execute statement 'select gen_id(' || out_name || ', 0) from rdb$database' into out_value;
suspend;
end
end