Subject RE: [firebird-support] generators
Author Thomas Steinmaurer
Luiz,

> How to get the last value generated by an generator
>
> Database name Teste2
> Generator name G_SRSR_RECNO that is used along with an trigger for an
> autoincrement field;

One of my auto-increment trigger looks like:

SET TERM ^^ ;
CREATE TRIGGER TRI_COUNTRY_ID FOR COUNTRY ACTIVE BEFORE INSERT POSITION 0 AS
begin
if (new.ID is null)
then new.ID = gen_id(GEN_COUNTRY_ID, 1);
end
^^
SET TERM ; ^^


GEN_COUNTRY_ID is the generator name.


HTH,
Thomas Steinmaurer
LogManager Serie - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com