Re: LAST_INSERT_ID ia a AFRTER INSERT trigger
Thanks Peter.
I had already tested this. I would like to know at what point last_insert_id() does return a value. The trigger body apparently isn't.
I did some more testing. The proper way is to use NEW.id.
It returns the correct value, whether inserted as a NULL, 0 (zero) or an INT value.
It returns the correct value when left out of the INSERT statement.
It returns the correct value for each seperate row when inserting multiple rows through an INSERT ... SELECT ... statement.
Hope this helps others.
Subject
Views
Written By
Posted
1756
October 01, 2018 03:48PM
835
October 01, 2018 05:44PM
Re: LAST_INSERT_ID ia a AFRTER INSERT trigger
801
October 04, 2018 02:19AM
759
October 04, 2018 08:27AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.