Purpose
Retrieves the XML content that is stored as an XMLCLOB type and stores it in an external server file.
Syntax
XMLCLOB to external server file |
---|
>>-Content--(--xmlobj--,--filename--)-------------------------->< |
Important: If a file with the specified name already exists, the content function overrides its content.
Parameters
Table 28. XMLCLOB to external server file parameters
Parameter | Data type | Description |
---|---|---|
xmlobj | XMLCLOB as LOCATOR | The XML document. |
filename | VARCHAR(512) | The fully qualified server file name. |
Return type
VARCHAR(512)
Example
The following example retrieves the XML content that is stored as an XMLCLOB type and stores it in an external server file.
CREATE table app1 (id int NOT NULL, order db2xml.XMLCLOB not logged); INSERT into app1 values (1, '<?xml version="1.0"?> <!DOCTYPE SYSTEM c:\dxx\samples\dtd\getstart.dtd"-> <Order key="1"> <Customer> <Name>American Motors</Name> <Email>parts@am.com</Email> </Customer> <Part color="black"> <key>68</key> <Quantity>36</Quantity> <ExtendedPrice>34850.16</ExtendedPrice> <Tax>6.000000e-02</Tax> <Shipment> <ShipDate>1998-08-19</ShipDate> <ShipMode>AIR </ShipMode> </Shipment> <Shipment> <ShipDate>1998-08-19</ShipDate> <ShipMode>BOAT </ShipMode> </Shipment> </Order>'); SELECT db2xml.Content(order, 'c:\dxx\samples\cmd\getstart.xml') from app1 where ID=1;