Good Day, I would like to run the following SQL in ij INSERT INTO users (name) VALUES (‘test’); And after the insert statement use the inserted id value to
complete other inserts in other tables. INSERT INTO attr (user_id, value) VALUES( INDENTITY_VAL_LOCAL(),
‘test attr’); INSERT INTO attr (user_id, value) VALUES( INDENTITY_VAL_LOCAL(),
‘test attr2’); <!—Problem here because the
IDENTITY_VAL_LOCAL() now contains the id that was generated in the previous
statement. How do I assign the identity value to a variable? Kind regards,
|
- Retrieving the identity column value after an insert Mark Ashworth
- Re: Retrieving the identity column value after an in... Kristian Waagan
- RE: Retrieving the identity column value after a... Mark Ashworth
- Re: Retrieving the identity column value aft... Kristian Waagan
- Re: Retrieving the identity column value aft... Stanley Bradbury
- Re: Retrieving the identity column value aft... Paul J DeCoursey