db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: Retrieving the identity column value after an insert
Date Tue, 01 Aug 2006 14:21:17 GMT
Mark Ashworth wrote:
> Hi,
>
> The problem is when you want to insert rows into other tables for each of
> the rows that have been inserted into to the user's table and those tables
> have identity fields. In this case it seems that without a variable to hold
> the userid, the IDENTITY_VAL_LOCAL() returns the new identity value from
> those other tables (which is to be expected).
>
> Regards,
> Mark P Ashworth
>   
=======   SNIP ========
A possible way to get around the problem is to use a temporary table to 
persist the values then perform the other table inserts by selecting 
from the temp/work table.

HTH


Mime
View raw message