MySQL Forums
Forum List  »  Triggers

Re: After Insert Trigger
Posted by: Ketaki Pandya
Date: June 21, 2019 11:07AM

Thank you very much!!!

Is there any work around for this? Please help.
Can you please advise how can I achieve below im mysql?

Whenever a new record has to be inserted into a table I need to check rather it exists in the table (matching on storeid, itemid and Orderdate) and if it finds the record in the table then it will compare on the Datetimestamp column and if the incoming record is latest record (latest datetimestamp) then all the old records will be inserted into History and then all the old records will be deleted from the table.

This is what I was successfully able to do in sql server but I am unable to do this in mysql as I cant delete from the same table on which trigger is created.

Options: ReplyQuote

Written By
June 21, 2019 10:40AM
June 21, 2019 10:54AM
Re: After Insert Trigger
June 21, 2019 11:07AM
June 25, 2019 01:29PM

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.