Unanswered: Is it possible to send XML file name to DB2 Stored Procedure ?
For testing purpose, I have a DB2 Stored Procedure below
create procedure tmpxml (IN DOC XML)
INSERT INTO tmp_xml (distributorid,sellingind)
SELECT d, s
FROM XMLTABLE('$X/Distributor' passing DOC as X
columns D INTEGER path 'DistributorId',
S CHAR(5) path 'Person/SellInd') AS x;
I know when I try to call it from UNIX using below, it works.
call tmpxml(XMLPARSE(DOCUMENT '<a>123</a>'))
However, in my actual environment, I may have an XML file which contains lots of line inside, which I am trying to avoid passing it as above.
Instead, I try to pass it using file name, like below, but it doesn't seems to work, please help, thanks in advance.
db2 => call tmpxml(XMLPARSE(DOCUMENT '/export/home/xml/samplefile.xml'))
SQL16132N XML document contains an invalid document structure.
SQLSTATE=2200M How can I fix this error if I want to pass the file name as parameter ??