Da es soweit ich das sehe keine Möglichkeit gibt den aktuellen Wert über die System-Tabellen direkt auszulesen habe ich da was zusammen gebastelt:
Code:
EXECUTE BLOCK RETURNS (gen_name varchar(31), gen_value integer)
AS
BEGIN
FOR
SELECT
rdb$generators.rdb$generator_name
FROM rdb$generators
WHERE rdb$generators.rdb$system_flag = 0
INTO :gen_name
DO
BEGIN
EXECUTE STATEMENT 'SELECT gen_id(' || :gen_name || ', 0) FROM rdb$database' into :gen_value;
SUSPEND;
END
END
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."