Subject | RE: [firebird-support] generators |
---|---|
Author | Thomas Steinmaurer |
Post date | 2004-05-14T14:48:08Z |
Luiz,
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
> How to get the last value generated by an generatorOne of my auto-increment trigger looks like:
>
> Database name Teste2
> Generator name G_SRSR_RECNO that is used along with an trigger for an
> autoincrement field;
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