我只是想简单地知道在我的过程中要编写哪些代码以确保不会发生丢失更新。 这是我的代码:
CREATE OR REPLACE PROCEDURE UpdBal (vcust3 number, vcust7 number) AS
BEGIN
update customer set balance = balance + 100 where custid = vcust3;
update customer set balance = balance - 100 where custid = vcust7;
END;
最佳答案
您可以使用事务和回滚。
关于mysql - 如何确保我的代码中不会发生更新丢失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58532842/