MySQL Forums
Forum List  »  Newbie

Inserting data to two tables
Posted by: Eran Yasso
Date: December 08, 2017 10:18AM

Hi,

My question is about inserting data to two tables.
If inserting the data to the second table fails, the data in the first one should be removed.
Currently I am doing this manually, meaning that I call DELETE for first one.
The problem with that is if before the delete my app crashes I will end in a situation I don't want.
Is there an option to do this using SQL query or stored procedure so mysql will do that?

Thanks,

Options: ReplyQuote


Subject
Written By
Posted
Inserting data to two tables
December 08, 2017 10:18AM
December 13, 2017 01:05PM
December 09, 2017 02:36PM
December 11, 2017 01:15AM
December 13, 2017 12:31AM


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.