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.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.