数据库存储过程丢失处理方法
1
在一些项目将备份的数据还原之后在平台修改添加参数提示报错,数据无法存储;
方法:连接数据库,进入指定数据库,执行以下命令
DELIMITER $$
USE wwyt
$$
DROP PROCEDURE IF EXISTS pzh
$$
CREATE DEFINER=root
@localhost
PROCEDURE pzh
(IN TYPES CHAR(2), IN tenentId BIGINT, IN orgCode VARCHAR(100), OUT ddh_return BIGINT)
SQL SECURITY INVOKER
BEGIN
START TRANSACTION;
SELECT seed INTO ddh_return FROM WWYT_BASE_BIZ_CODE_SEED
WHERE BIZ_POINT=TYPES AND TENENT_ID = tenentId AND ORG_CODE = orgCode FOR UPDATE;
UPDATE WWYT_BASE_BIZ_CODE_SEED SET SEED=SEED+1 WHERE BIZ_POINT=TYPES AND TENENT_ID = tenentId AND ORG_CODE = orgCode;
COMMIT;
END$$
DELIMITER ;
转载请注明作者和出处,并添加本页链接。
原文链接:
//svn.seekcy.com:33382/546