Subject | Listing current generator values, execute statement |
---|---|
Author | Bob Murdoch |
Post date | 2004-01-29T14:24:27Z |
Using FB1.5, dialect 1, I'm trying to put together a stored proc to return
the current values of all non-system generators. However, I seem to be
having a problem with the new EXECUTE STATEMENT:
create procedure debug_get_generator_values
returns (GENERATOR_NAME varchar(35), CURRENT_VALUE integer)
as
begin
for
select
rdb$generator_name
from
rdb$generators
where
rdb$system_flag is NULL
into
:generator_name
do begin
execute statement 'select gen_id(' || generator_name || ',0) from
rdb$database'
into :current_value;
suspend;
end
end
The error is:
Variable type (position 0) in Execute Statement 'select
gen_id(batch_nbr_gen ,0) f' does not match return.
I'm assuming that the value returned from gen_id is not an integer?
Is there another way to get a list of all generators and their current values?
tia,
Bob M..
the current values of all non-system generators. However, I seem to be
having a problem with the new EXECUTE STATEMENT:
create procedure debug_get_generator_values
returns (GENERATOR_NAME varchar(35), CURRENT_VALUE integer)
as
begin
for
select
rdb$generator_name
from
rdb$generators
where
rdb$system_flag is NULL
into
:generator_name
do begin
execute statement 'select gen_id(' || generator_name || ',0) from
rdb$database'
into :current_value;
suspend;
end
end
The error is:
Variable type (position 0) in Execute Statement 'select
gen_id(batch_nbr_gen ,0) f' does not match return.
I'm assuming that the value returned from gen_id is not an integer?
Is there another way to get a list of all generators and their current values?
tia,
Bob M..