Has anyone used an xml field?
So I have learned that v7r1 DB2 has native xml support automatically.
I have created a table... with ID Bigint Identity, Type smallint,
Request xml.
This is my SQL using System i Navigator... I am running manual queries
until I can get it working, as it is failing in my PHP...
If all I insert is the Type... everything is fine... I have edited the
XML down to a single line.... still no joy...
insert into KWDB108.XMLReq ( Type, Request ) VALUES ( 2, '<?xml
version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:storis="
http://Storis">
<soapenv:Body>
<company:CreditApplicationRequest>
<mainFirstName>Jack</mainFirstName>
<mainLastName>Smith</mainLastName>
<mainMiddleInitial>A</mainMiddleInitial>
</company:CreditApplicationRequest>
</soapenv:Body>
</soapenv:Envelope>' ) ;
In The System i Messages Box I get....
INSERT INTO KWDB108.XMLReq ( Type, Request ) VALUES ( 2, '<?xml
version="1.0" encoding="utf-8"?> <soapenv:Envelope
xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:storis="
http://Storis"> <soapenv:Body>
<company:CreditApplicationRequest> <mainFirstName>Jack</mainFirstName>
<mainLastName>Smith</mainLastName>
<mainMiddleInitial>A</mainMiddleInitial>
</company:CreditApplicationRequest> </soapenv:Body> </soapenv:Envelope>' )
SQL State: 2200M
Vendor Code: -16168
Message: [SQ16168] XML declaration in XML document not valid. Cause . .
. . . : The XML declaration in the XML document or XML schema is
incorrect. The error type is 7. The error types are: 1 -- Unsupported
Byte Order Mark, declaration string order is incorrect, declaration must
be in lower case, the 'version=' string is missing, or unsupported
attributes were specified. 6 -- Specified version is not supported. 7 --
Specified encoding is not supported, or the internal encoding does not
match the external encoding. 8 -- The XML declaration is not terminated.
Recovery . . . : Correct the XML document. Try the request again.
The error codes are so vague....
Thanks,
Rob
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
As an Amazon Associate we earn from qualifying purchases.