Subject | Re: [firebird-support] auto increment field |
---|---|
Author | Nando Dessena |
Post date | 2003-10-20T19:08:31Z |
Yves, Martijn,
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@...
>> Actually, I think auto-inc fields are an abomination when it comes toDitto.
>> multi user etc access. Generators are much more powerful
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@...