我是存储过程的新手,正在尝试创建一个简单的存储过程来从表中读取数据。我正在使用 IBM DB2 SQL。
--#SET MAXERRORS 0
--#SET TERMINATOR ~
SET CURRENT SQLID = 'SIWRO1'~
CREATE OR REPLACE PROCEDURE DWR000A.SELECT_PSID_RIZ(
IN P_CONN INT
,IN P_PLNN INT
)
LANGUAGE SQL
RESULT SETS 1
READS SQL DATA
BEGIN
DECLARE C1 CURSOR FOR
SELECT PSID,
JOBINFO
FROM DWR000A.TEST
WHERE CONN = P_CONN
AND PLNN = P_PLNN;
OPEN C1;
END
~
--#SET TERMINATOR ;
COMMIT;
执行时出现以下错误。
SQLERROR ON CREATE COMMAND, PREPARE FUNCTION
RESULT OF SQL STATEMENT:
DSNT408I SQLCODE = -4743, ERROR: ATTEMPT TO USE A FUNCTION WHEN THE APPLICATION COMPATIBILITY SETTING IS SET FOR A PREVIOUS LEVEL
DSNT418I SQLSTATE = 56038 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHSM5R SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 50 0 0 -1 1 2721 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'00000032' X'00000000' X'00000000' X'FFFFFFFF'
INFORMATION
我不知道我做错了什么,也不知道该如何解决。我很感激一些专家的建议。谢谢
更新 11/28/2024 我设法通过执行 1 个函数(即创建)来绕过错误。谢谢