Subject Re: [firebird-support] auto increment field
Author Nando Dessena
Yves, Martijn,

>> Actually, I think auto-inc fields are an abomination when it comes to
>> multi user etc access. Generators are much more powerful

Ditto.

Y> I think addition of the autoincrement property
Y> would lower the entry barrier. :-)

The jack of all trades here would be adding support for the RETURNING
clause to the insert statement. That way you can have a trigger that
uses a generator to set an OID value and issue a statement like this
one:

insert into table (...) values (...) returning OID;

And get the OID value in the client for whatever purpose (typically
refetch the record or insert detail records - actually refetching
would not be strictly necessary with the returning clause).
With this building block in place, then you could even automate the
trigger+generator thing with a simple keyword.

It's more complicated than this, though, because it would transform
the insert statement into one capable of returning a cursor (just think
about multi-row inserts).

Ciao
--
Nando mailto:nandod@...