db2自定义函数错误 5
以下为db2的自定义函数,报错:消息:"NEXTVALFORDB2INST1.SEQ_SERIAL"cannotbespecifiedinthiscontext..SQL...
以下为db2的自定义函数,报错:
消息: "NEXTVAL FOR DB2INST1.SEQ_SERIAL" cannot be specified in this context.. SQLCODE=-348, SQLSTATE=428F9, DRIVER=3.50.152
请各位大神帮忙看一下,谢谢
CREATE FUNCTION DB2INST1.GETID(pre varchar(100) default 'C')
returns varchar(100)
LANGUAGE SQL
begin ATOMIC
declare myret varchar(100);
set myret=(select '000000000000000000000' || nextval for DB2INST1.seq_serial from SYSIBM.SYSDUMMY1);
set myret = substr(myret,length(myret)-7);
set myret = pre || myret;
return myret;
end
GO 展开
消息: "NEXTVAL FOR DB2INST1.SEQ_SERIAL" cannot be specified in this context.. SQLCODE=-348, SQLSTATE=428F9, DRIVER=3.50.152
请各位大神帮忙看一下,谢谢
CREATE FUNCTION DB2INST1.GETID(pre varchar(100) default 'C')
returns varchar(100)
LANGUAGE SQL
begin ATOMIC
declare myret varchar(100);
set myret=(select '000000000000000000000' || nextval for DB2INST1.seq_serial from SYSIBM.SYSDUMMY1);
set myret = substr(myret,length(myret)-7);
set myret = pre || myret;
return myret;
end
GO 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询