具体创建过程如下,创建函数功能也已经开启了,这边是想实现一个递归查树的功能
delimiter $$
create function WAP_SERVICE.test_function(in_id varchar(16))
returns varchar(1000)
begin
declare idss varchar(1000) default '';
declare tempids varchar(1000);
set tempids=in_id;
while tempids is not null do
set idss=concat_ws(',',idss,tempids);
select GROUP_CONCAT(cfg_id) into tempids from WAP_SERVICE.w_workaccept_cfg where FIND_IN_SET(parent_id,concat("'",tempids,"'"))>0;
end while;
return idss;
end $$
delimiter ;
报错具体信息如下
Error Code: 1064. You have an error in your SQL syntax; check sql TODO FUNCTION 0.000 sec