Use: VALUES IDENTITY_VAL_LOCAL()
As the docs say: IDENTITY_VAL_LOCAL() is a "function that returns the most recently assigned value of an identity column for a connection" -- emphasis on _connection_. You can't select the latest value for a specific table. Dan On 19/09/06, Tim Dudgeon <[EMAIL PROTECTED]> wrote:
Barry Books wrote: > try SELECT IDENTITY_VAL_LOCAL() from sysibm.sysdummy1 Its get more weird! SELECT IDENTITY_VAL_LOCAL() from sysibm.sysdummy1 returns 1 row SELECT IDENTITY_VAL_LOCAL() from the_actual_table_name returns as many rows as there are in the table, all with the value of the last ID. Tim
