Invoke XMLSERVICE from PASE shell
Issue #5
resolved
I am in a situation where it would be handy to invoke XMLSERVICE from a shell script. Being able to do so will allow me to eliminate the need to install Ruby/Node.js/Python iToolKits.
Here's what I have so far:
$ alias db2='function _db2(){ echo "Running $1"; system -i "call QSYS/QZDFMDB2 parm('\''$1'\'')"; };_db2'
$ db2 "CALL QXMLSERV.iPLUG4K('''', ''*immed'', ''<?xml version="1.0"?>'', ?)"
Running CALL QXMLSERV.iPLUG4K('''', ''*immed'', ''<?xml version=1.0?>'', ?)
**** CLI ERROR *****
SQLSTATE: 07001
NATIVE ERROR CODE: -313
Number of host variables not valid.
This error makes sense, but I am not finding a way to specify a host variable from a shell to obtain the output of the last parameter. I believe this might be remedied by wrapping iPLUG4K
with another RPG program that writes to standard out, but I wanted to first check if anyone has gotten it to work without that.
Comments (2)
-
Account Deleted -
reporter - changed status to resolved
Works perfect! Closing issue.
- Log in to comment
Wrong stored proc iPLUG4K has I/O last parm (forbidden). Switch to iPLUGR4K for a natural result set (below).
FYI -- Although on a personal note, languages and toolkits are for normal people (you shell hacker).