DB2调用自定义函数时报错, DB2 Database Error: ERROR [42884] [IBM][DB2/AIX64] SQL0440N
报错提示DB2DatabaseError:ERROR[42884][IBM][DB2/AIX64]SQL0440NNoauthorizedroutinenamed函数体:...
报错提示
DB2 Database Error: ERROR [42884] [IBM][DB2/AIX64] SQL0440N No authorized routine named
函数体:
SET SCHEMA = "CCREEKP";
SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","SYSIBMADM","DB2INST2";
CREATE FUNCTION "CCREEKP"."F_PINGATE_QUESTION1" (
"STR1" VARCHAR(200),
"STR2" VARCHAR(200) )
RETURNS VARCHAR(200)
SPECIFIC "SQL150724174814300"
LANGUAGE SQL
NOT DETERMINISTIC
EXTERNAL ACTION
READS SQL DATA
CALLED ON NULL INPUT
INHERIT SPECIAL REGISTERS
BEGIN ATOMIC
declare str3 varchar(200) DEFAULT '';
declare i int DEFAULT 0;
set i = length(str1) - length(replace(str1,';',''));
set str3 = '2222';
return str3;
END;
GRANT EXECUTE ON FUNCTION "CCREEKP"."F_PINGATE_QUESTION1"( VARCHAR(200), VARCHAR(200) ) TO USER "DB2INST2" WITH GRANT OPTION;
--调用语句
select f_pingate_question1(fd_answer,fd_answer) from KM_PINDAGATE_QUESTION_RES 展开
DB2 Database Error: ERROR [42884] [IBM][DB2/AIX64] SQL0440N No authorized routine named
函数体:
SET SCHEMA = "CCREEKP";
SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","SYSIBMADM","DB2INST2";
CREATE FUNCTION "CCREEKP"."F_PINGATE_QUESTION1" (
"STR1" VARCHAR(200),
"STR2" VARCHAR(200) )
RETURNS VARCHAR(200)
SPECIFIC "SQL150724174814300"
LANGUAGE SQL
NOT DETERMINISTIC
EXTERNAL ACTION
READS SQL DATA
CALLED ON NULL INPUT
INHERIT SPECIAL REGISTERS
BEGIN ATOMIC
declare str3 varchar(200) DEFAULT '';
declare i int DEFAULT 0;
set i = length(str1) - length(replace(str1,';',''));
set str3 = '2222';
return str3;
END;
GRANT EXECUTE ON FUNCTION "CCREEKP"."F_PINGATE_QUESTION1"( VARCHAR(200), VARCHAR(200) ) TO USER "DB2INST2" WITH GRANT OPTION;
--调用语句
select f_pingate_question1(fd_answer,fd_answer) from KM_PINDAGATE_QUESTION_RES 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询