gpt4 book ai didi

sql - MySQL程序?功能?

转载 作者:行者123 更新时间:2023-11-29 15:11:08 24 4
gpt4 key购买 nike

我需要有一个例程/函数/存储过程/任何东西来将特定帐户从我们的“事件”表存档到非事件表。

我可以将其写为一组查询,所有查询一次都按顺序由 PHP 执行,但我希望将大部分工作转移到 mysql,因为 PHP 没有必要参与其中。

基本上,这将获取所有数据:

insert into credit_archive_acc select  * from credit_acc where uid_usr = n; 
delete from credit_acc where uid_usr =n;
insert into user_archive_usr select * from user_usr where id_usr = n;
delete from user_usr where id_usr = n;

(我将对另外 3 个表执行此操作)

无论如何,我希望能够做这样的事情:调用 archive_account(n);并让它完成所有工作(如果失败则作为事务回滚)

我对mysql的要求是不是太高了?

最佳答案

关于sql - MySQL程序?功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/369119/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com