gpt4 book ai didi

mysql - 如何更新这个存储过程?

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

这是我更新存储过程中的 2 个表的代码

 DROP PROCEDURE IF EXISTS `SP_ENGG_UPDATE_ITEM_SERVICE`;
DELIMITER $$

CREATE PROCEDURE `SP_ENGG_UPDATE_ITEM_SERVICE`(
IN `p_uid` BIGINT(20) UNSIGNED,
IN `p_sid` BIGINT(20) UNSIGNED,
IN `p_sdid` BIGINT(20) UNSIGNED,
IN `p_mediaJson` TEXT,
IN `p_itemStatus` TINYINT(1),
IN `p_mediavalue` TEXT)
BEGIN
DECLARE stcount int DEFAULT 0;
DECLARE ttcount int DEFAULT 0;
SET @updated = 0;
IF(p_sid > 0 && p_sdid > 0 ) THEN
UPDATE user_service_details SET
p_mediavalue = p_mediaJson,
status = p_itemStatus
WHERE user_service_id = p_sid AND id =p_sdid;

SET stcount = (SELECT count(*) FROM user_service_details WHERE user_service_id = p_sid AND status = 2 );
SET ttcount = (SELECT count(*) FROM user_service_details WHERE user_service_id= p_sid );

IF (stcount = ttcount) THEN
UPDATE user_service SET
status= 4
WHERE id = p_sid AND engg_id = p_uid ;
END IF;
SET @updated = 1;
END IF;
SELECT @updated;
END

这是我要更新的查询

call SP_ENGG_UPDATE_ITEM_SERVICE(252317018022627,25231702221634,252302221637,
'{"images":["img1.png","img2.png","img3.png"],"videos":["vid1.mp4","vid2.mp4","vid3.mp4"],"audios":["aud1.mp3","aud2.mp3","aud3.mp3"]}',2,'before_image');

当我尝试更新时,显示此错误:-

Error Code: 1054 Unknown column 'p_mediavalue' in 'field list'  

任何人都知道如何更新。

最佳答案

user_service_details中的列名称user_service_details是错误的,根据抛出的错误“未知列名称”。

关于mysql - 如何更新这个存储过程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46278648/

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