Subject | Re: [firebird-support] Last_inserted_id, auto creating relationships |
---|---|
Author | Ann W. Harrison |
Post date | 2005-12-02T16:23:37Z |
Adomas Urbanavicius wrote:
to the insert verb that returns values from the inserted row. The
syntax will be something like this:
INSERT INTO <table> (<field list>) VALUES (<value list>) RETURNING
(<field list>)
read committed transactions.
Regards,
Ann
> Hi,Not conveniently in V1.x, but V2 includes a new feature - an extension
> Is there any posibility to find out inserted ID in the middle of sql
> script ?
to the insert verb that returns values from the inserted row. The
syntax will be something like this:
INSERT INTO <table> (<field list>) VALUES (<value list>) RETURNING
(<field list>)
>Right.
> As far, as I know:
> 1. Create SP to handle it with local variable.
> 2. Select gen_id(my_gen,0) from rdb$databaseAs you noticed, this doesn't work in the multi-user case.
> 3. Select max(id)That's expensive unless you have a descending index, and unreliable for
read committed transactions.
Regards,
Ann