Subject Re: [firebird-support] Generators Associated with a Table
Author Milan Babuskov
Milan Babuskov wrote:
> create trigger tx1 for table1
> before insert
> as
> begin
> if exists (select * from table1 where pk = new.pk) then
> begin
> select max(pk) from table1 into new.pk;

This should be: select max(pk)+1 from table1 into new.pk;

> end
> end

Not my day today :(

--
Milan Babuskov
http://fbexport.sourceforge.net