我正在测试 Db2 for z/OS 的一些功能,现在当我尝试通过 REXX 调用存储过程时遇到了麻烦。
Bellow 是创建我需要在存储过程中返回的数据类型的代码
CREATE TYPE *******.ARRAY_TESTE AS VARCHAR(186) ARRAY[200];
这是我用来创建存储过程的 DDL
CREATE PROCEDURE *******.TESTE_EMP2
(OUT EDLEVELARR MYVARRTYPE,
OUT LASTNAMEARR MYVARRTYPE)
VERSION MEDIAN_V1
LANGUAGE SQL
NOT DETERMINISTIC
READS SQL DATA
CALLED ON NULL INPUT
DYNAMIC RESULT SETS 1
DISABLE DEBUG MODE
PARAMETER CCSID EBCDIC
QUALIFIER *******
PACKAGE OWNER ******
ASUTIME NO LIMIT
COMMIT ON RETURN NO
INHERIT SPECIAL REGISTERS
NODEFER PREPARE
CURRENT DATA NO
DEGREE 1
DYNAMICRULES RUN
WITHOUT EXPLAIN
WITHOUT IMMEDIATE WRITE
ISOLATION LEVEL CS
WITHOUT KEEP DYNAMIC
OPTHINT ''
RELEASE AT COMMIT
REOPT NONE
VALIDATE RUN
ROUNDING DEC_ROUND_HALF_EVEN
DECIMAL(31)
BUSINESS_TIME SENSITIVE NO
SYSTEM_TIME SENSITIVE NO
ARCHIVE SENSITIVE NO
BEGIN
SELECT ARRAY_AGG(VARCHAR(EDLEVEL)), ARRAY_AGG(LASTNAME)
INTO EDLEVELARR, LASTNAMEARR
FROM DSN81110.EMP ;
END `
这就是我用来调用存储过程的 REXX
LOCAL_DB2 = ****
ADDRESS DSNREXX
RC = 'SUBCOM DSNREXX'
OUTTRAP TESTE_DATA.
TESTE_DATA2.
IF RC <> 0 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
END
"CONNECT " LOCAL_DB2
IF SQLCODE <> +0 THEN DO
MY_ERROR = 'ERROR CONNECTING TO DB2 ' LOCAL_DB2
END
EXECSQL "CALL *******.TESTE_EMP2(:TESTE_DATA.,:TESTE_DATA2.)"
IF (SQLCODE<>0) THEN
CALL SQL_ERROR
ADDRESS DSNREXX
"DISCONNECT"
S_RC = RXSUBCOM('DELETE','DSNREXX','DSNREXX')
EXIT
现在我有 SQLCODE
-301 THE VALUE OF INPUT VARIABLE OR ARGUMENT NUMBER position-number CANNOT BE USED AS SPECIFIED BECAUSE OF ITS DATA TYPE
你能帮我吗,我试图将存储过程的输出返回到 REXX 程序,它说我在 CALL 中使用的变量与我在存储过程中定义的变量不兼容。
我不明白是什么问题,你能帮帮我吗?
提前问候