gpt4 book ai didi

mysql存储过程列错误

转载 作者:行者123 更新时间:2023-11-29 14:37:53 26 4
gpt4 key购买 nike

我收到以下错误。但我没有在存储过程中输入 count 那么为什么会出现此错误?

  CALL updateproposalStatus(1,5)    Error Code: 1136. Column count doesn't match value count at row 1

存储过程:

CREATE DEFINER=`root`@`localhost` PROCEDURE `updateProposalStatus`(IN decision INT, IN x INT)
BEGIN
DECLARE adv_id varchar(30);
DECLARE std_id varchar(30);
DECLARE topic varchar(255);

select
a.id INTO adv_id
from
rp_proposal p
inner join rp_adviser a on p.rp_adviser_id = a.id
where p.proposal_id=x;

select
s.id INTO std_id
from
rp_proposal p
inner join rp_student s on p.rp_student_id = s.id
where p.proposal_id=x;

select
p.title INTO topic
from
rp_proposal p
where p.proposal_id=x;

UPDATE rp_proposal_status
SET state_rp_controller =decision
WHERE rp_proposal_id = x;

IF decision = 1 THEN
INSERT INTO rp_indpstudy VALUES (topic,adv_id,std_id);
END IF;
END

最佳答案

它提示的是列计数(列数),而不是名为 count 的列。

最有可能的罪魁祸首是末尾的 insert 语句 - 确保它与 rp_indpstudy 的架构一致。

关于mysql存储过程列错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8629756/

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