我目前正在做一个进程,它需要提交一个存储过程接收另一个存储过程中的参数,这是我正在形成的代码:
SET PARAMETROS1 = '''<root><esquema></esquema></root>''' ;
SET PARAMETROS2 = '''CALL ' || ESQUEMAOR || '.PRU_LLAMA(''' || PARAMETROS1 || ''')''' ;
SET SENTENCIA = '''SBMJOB CMD(CALL PGM(QZDFMDB2) PARM(' || PARAMETROS2 || ')) JOB(MIGRA14) JOBQ(QGPL/TEL)''' ;
SET MAXLENGTH = LENGTH ( TRIM ( SENTENCIA ) ) ;
SET MAXLENGTH = LENGTH ( SENTENCIA ) - 4 ;
SET NUMERO = CAST ( MAXLENGTH AS VARCHAR ( 10 ) ) ;
WHILE ( LENGTH ( NUMERO ) < 10 ) DO
SET NUMERO = '0' || NUMERO ;
END WHILE ;
SET STMT_QUERY = 'CALL QSYS.QCMDEXC(' || SENTENCIA || ' , ' || NUMERO || '.00000)' ;
PREPARE STMT1 FROM STMT_QUERY ;
EXECUTE STMT1 ;
我犯了以下错误:
不期望关键字CALL。有效代币:),
* 需要你的帮助*
答案 0 :(得分:2)
尝试
EXECUTE spName Param1, ..., ParamN