Subject Re: [firebird-support] Generators Associated with a Table
Author Phil Shrimpton
On Tuesday 11 November 2003 15:59, Milan Babuskov wrote:

Hi,

> You could then just replace PK value with max(PK) + 1, like this:
>
> 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;
> end
> end

Which is not mutil-user safe

Phil

--
3:33pm up 63 days, 17:43, 1 user, load average: 0.49, 0.26, 0.20
ICQ: 760757 | AIM: pjshrimpton | Y!: pjshrimpton | pjshrimpton@...