• 全部
  • 问答

Oracle函数修改赋值到Mysql后,存储时报1064错误,求帮助

coca可乐 2016-03-29 09:54:15
原Oracle函数
create or replace FUNCTION "GET_ADMINDEPTIDS"
(
adminid IN NUMBER
) RETURN VARCHAR2 AS
v_sql varchar2(500);
v_deptids varchar(4000);
type v_avarchar2_type is record (
thevalue number
);
v_avarchar2 v_avarchar2_type;
TYPE i_cursor_type IS REF CURSOR;
c i_cursor_type;
BEGIN
v_sql := 'select deptid from admindept
where adminid = ' || adminid;
v_deptids := '';
open c for v_sql;
loop
fetch c into v_avarchar2;
exit when c%notfound;
v_deptids := v_deptids || v_avarchar2.thevalue || ',';
end loop;
close c;
RETURN substr(v_deptids, 0, length(v_deptids) - 1);
END GET_ADMINDEPTIDS;

Mysql中函数
create or REPLACE FUNCTION "GET_ADMINDEPTIDS"
(
adminid IN BIGINT
) RETURN VARCHAR
v_sql varchar(500);
v_deptids varchar(4000);
type v_avarchar2_type is record (
thevalue number
);
v_avarchar2 v_avarchar2_type;
TYPE i_cursor_type IS REF CURSOR;
c i_cursor_type;
BEGIN
v_sql := 'select deptid from admindept
where adminid = ' || adminid;
v_deptids := '';
open c for v_sql;
loop
fetch c into v_avarchar2;
exit when c%notfound;
v_deptids := v_deptids || v_avarchar2.thevalue || ',';
end loop;
close c;
RETURN substr(v_deptids, 0, length(v_deptids) - 1);
END GET_ADMINDEPTIDS;
报错:
...全文
53 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复

还没有回复,快来抢沙发~

相关推荐
发帖
MySQL
创建于2007-09-28

5.5w+

社区成员

MySQL相关内容讨论专区
申请成为版主
帖子事件
创建了帖子
2016-03-29 09:54
社区公告
暂无公告