0

Mysql Transaction innoDB

I need help making transactions on mysql, i'm doing this but it doesn't work: START TRANSACTION; INSERT INTO TipoPedido ('TipoPedi') VALUES ('3'); INSERT INTO TipoPedido ('TipoPedi') VALUES ( '4'); ROLLBACK;

1st Feb 2020, 7:57 PM
Bruno Guilherme
Bruno Guilherme - avatar
6 Answers
+ 1
What do you want to do exactly? What is that table you have? How do you want your result to look like?
1st Feb 2020, 8:28 PM
Avinesh
Avinesh - avatar
0
I want to do 3 querry, but if one fail, i want to cancel the other 2
1st Feb 2020, 9:09 PM
Bruno Guilherme
Bruno Guilherme - avatar
0
So you want to insert 3 records. What do you mean by if one fail?
1st Feb 2020, 9:14 PM
Avinesh
Avinesh - avatar
0
If querry fail because is receiving a duplicate entry The 3 querry are from different tables that are related, i want to make a rollback if one fails
1st Feb 2020, 9:18 PM
Bruno Guilherme
Bruno Guilherme - avatar
0
The Rollback; should work in that case but still I cannot understand your question properly.
1st Feb 2020, 9:22 PM
Avinesh
Avinesh - avatar
0
Rollback is not working whit me
1st Feb 2020, 9:28 PM
Bruno Guilherme
Bruno Guilherme - avatar