admin管理员组文章数量:1402815
I'm trying to run the command from .NET C# using non-query SQL commands on the AS400.
CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF)', 0000000132.00000)
But when I run it, I get the following error:
SQL Status: 38501 Vendor Code: -443 Message: [CPF0006] Errors occurred in the command. Cause: If an incorrect length was passed in part of the command, other messages are issued as the erroneous part of the command is parsed. Recovery: .: See the messages listed above in the job log. Correct any errors and resubmit the command. Processing has been terminated because the highlighted statement did not complete successfully.
Enviar comentarios Paneles laterales Historial Guardado
I'm trying to run the command from .NET C# using non-query SQL commands on the AS400.
CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF)', 0000000132.00000)
But when I run it, I get the following error:
SQL Status: 38501 Vendor Code: -443 Message: [CPF0006] Errors occurred in the command. Cause: If an incorrect length was passed in part of the command, other messages are issued as the erroneous part of the command is parsed. Recovery: .: See the messages listed above in the job log. Correct any errors and resubmit the command. Processing has been terminated because the highlighted statement did not complete successfully.
Enviar comentarios Paneles laterales Historial Guardado
Share Improve this question edited Mar 21 at 19:39 jarlh 44.8k8 gold badges50 silver badges67 bronze badges asked Mar 21 at 19:24 raabsoftraabsoft 112 bronze badges 1- Not real sure what that last sentence means. Please write it in english. – jmarkmurphy Commented Mar 21 at 20:32
3 Answers
Reset to default 0You don't mention what release of IBM i OS you are running...
But assuming a supported (or even somewhat recent 7.1+) one, you do not need to pass along the command length any more.
CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF))'
However, passing the correct length as you've done originally should still work AFAIK.
You're going to need to look in the job log of the servicing job (that's handling the .NET connection) to see what prior messages were logged.
From SQL yo can try
CL: CALL QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/xxxxxx.PDF) STMFOPT(*REPLACE) WSCST(*PDF)', 0000000132.00000);
I don't know C# but from interactive SQL (in ACS) this works
Finally, the solution was to enclose the TOSTMF parameter in a double apostrophe TOSTMF(''/REPORTS/xxxxxx.PDF'')
CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(''/REPORTES/xxxxxx.PDF'') STMFOPT(*REPLACE) WSCST(*PDF))'
本文标签: sqlCALL QSYS2QCMDEXC AS400Stack Overflow
版权声明:本文标题:sql - CALL QSYS2.QCMDEXC AS400 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744337230a2601262.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论