Some pointers need for Narayanan here.

thanks
Shreyas
--- Begin Message ---
Hi,
I had a few doubts regarding the working of the identity_val_local function.

An insert statement containing --generated by default as identity-- does a getSetAutoincrementValues to get and set values from the SYSCOLUMNS table. so in effect it takes the identity column value from the SYSCOLUMNS table.

The identity_val_local() function returns the last single statement insert value for the identity column.

1) while single-stepping through the code I understood that it that it does not access the SYSCOLUMNS table to get the values

2) Initially when I create a fresh table using the following statement

create table tauto(i int generated by default as identity,j int,k int);

and do a insert with the IDENTITY COLUMN VALUE SPECIFIED and then invoke the identity_val_local() it returns NULL.

(e.g. insert into tauto values(1,2,3))

3) also when I start the database for the first time do a insert with THE IDENTITY COLUMN VALUE SPECIFIED and again invoke identity_val_local it returns NULL.

I reach a dead end here. Can anyone throw some light on

a)How the identity_Val_local() related to the earlier insert and from

b)where other than the SYSCOLUMNS table does it obtain the auto generated key value.

thanx
Narayanan





--- End Message ---

Reply via email to