mysql自定义函数查询会报错 应该是死循环吧

BEGIN
DECLARE sTemp text;
DECLARE sTempChd text;
SET@@group_concat_max_len = 102400;
SET sTemp = '$';
SET sTempChd = rootId;
WHILE sTempChd IS NOT NULL DO
SET sTemp = concat(sTemp, ',', sTempChd);
SELECT
group_concat(comcode) INTO sTempChd
FROM
PrpDcompany
WHERE

FIND_IN_SET(UPPERCOMCODE, sTempChd) > 0;
END WHILE;
SET@@group_concat_max_len = 1024;
RETURN SUBSTRING(sTemp,3);
END
这是函数

    这是sql
    select * from PrpDcompany 
where FIND_IN_SET(COMCODE, Dcompany(1044)); 

    这是错误
    [SQL]select * from PrpDcompany 
where FIND_IN_SET(COMCODE, Dcompany(1044));

[Err] 1406 - Data too long for column 'sTemp' at row 53

1个回答

sTemp 数据长度太长了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问