gpt4 book ai didi

sql - INTO 列表中声明的变量数量必须与所选列的数量相匹配

转载 作者:行者123 更新时间:2023-12-02 22:09:36 24 4
gpt4 key购买 nike

我已经检查过好几次了。列计数匹配,但我不断收到错误消息,指出 fetch into 语句与计数不匹配

declare cur_range CURSOR FOR
SELECT
GroupID,
OddEven,
RangeLow,
RangeHigh
PostCode1,
PostCode2,
ID,
OldPrimaryID,
ThFareID
FROM tmpNewPrimaryRange;

OPEN cur_range

FETCH NEXT FROM cur_range
into
@cur_GroupID
, @cur_OddEven
, @cur_RangeLow
, @cur_RangeHigh
, @cur_PostCode1
, @cur_PostCode2
, @cur_ID
, @cur_OldPrimaryID
, @cur_ThFareID

Error: Cursorfetch: The number of variables declared in the INTO list must match that of selected columns.

最佳答案

如果您在列之前或之后一致地放置逗号,您可能会发现这一点:

declare cur_range CURSOR FOR
SELECT
GroupID,
OddEven,
RangeLow,
RangeHigh --- <-- ******* NO COMMA HERE ******
PostCode1,
PostCode2,
ID,
OldPrimaryID,
ThFareID

这就是说SELECT ... RangeLow, RangeHigh AS PostCode1, PostCode2 ...

关于sql - INTO 列表中声明的变量数量必须与所选列的数量相匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18363224/

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