注册

mysql函数迁移到DM8,显示创建的对象带有编译错误。错误信息:无效的数据类型

ql.t 2022/08/30 714 2 已解决

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:DM8
【操作系统】:通信信创系统
【CPU】:
【问题描述】*:mysql的函数,迁移到达梦8,执行完成显示创建的对象带有编译错误

mysql函数语句:
CREATE FUNCTION get_sub_org_list(in_id bigint(20))
RETURNS VARCHAR(1000)
begin
declare ids varchar(1000) default ‘’ ;
declare tempids varchar(1000) ;

set tempids = CAST(in_id AS CHAR);
while tempids is not null do
set ids = CONCAT_WS(‘,’,ids,tempids);
select GROUP_CONCAT(id) into tempids from mscode_sys_org where FIND_IN_SET(parent_id,tempids)>0;
end while;
return ids;
end;

达梦8函数语句:
Create Function landtool.get_sub_org_list(in_id bigint(20))
Return VARCHAR(1000)
as
DECLARE
ids varchar(1000) default ‘’;
tempids varchar(1000);
begin
tempids := CAST(in_id AS CHAR);
while tempids is not null LOOP
ids := CONCAT_WS(‘,’,ids,tempids);
select wm_concat(id) as tempids from mscode_sys_org where instr(parent_id,tempids)>0;
end LOOP;
Return ids;
end;

执行结果:
image.png

错误信息:提示无效的数据类型
image.png

回答 0
暂无回答
扫一扫
联系客服