MySQL Forums
Forum List  »  Triggers

LAST_INSERT_ID ia a AFRTER INSERT trigger
Posted by: Hans Verdel
Date: October 01, 2018 03:48PM

I'm trying to duplicate data inserted by one application into another aplication's table. Both use auto-increment id's as the primary key.
The operation is performed by a stored procedure called from the after insert trigger on the original table.

Using last_insert_id() however keeps returning '0'.

Can someone please confirm that this is the way it works.
If not, does anyone know how to solve the problem?

I'm using triggers on the original tables, because i have no way to modify the application. All i can act on is the data being inserted.

Options: ReplyQuote


Subject
Views
Written By
Posted
LAST_INSERT_ID ia a AFRTER INSERT trigger
130
October 01, 2018 03:48PM


Sorry, only registered users may post in this forum.

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.