IBM Books

XML Extender Administration and Programming

XMLFileFromCLOB()

Purpose

Reads an XML document as CLOB locator, writes it to an external server file, and returns the file name and path as an XMLFILE type.

Syntax
XMLFileFromCLOB
>>-XMLFileFromCLOB--(--buffer--,--fileName--)------------------><
 

Parameters

Table 25. XMLFileFromCLOB() parameters
Parameters Data type Description
buffer CLOB as LOCATOR The buffer containing the XML document.
fileName VARCHAR(512) The fully qualified server file name.

Return type

XMLFILE

Example

The following example reads an XML document as CLOB locator, writes it to an external server file, and inserts the file name and path as an XMLFILE type in an XML column.

EXEC SQL BEGIN DECLARE SECTION;
     SQL TYPE IS CLOB_LOCATOR xml_buff;
EXEC SQL END DECLARE SECTION;
 
EXEC SQL INSERT INTO sales_tab(ID, NAME, ORDER) 
   VALUES('1234', 'Sriram Srinivasan', 
           XMLFileFromCLOB(:xml_buf, 'c:\dxx\samples\cmd\getstart.xml'))

The column ORDER in the SALES_TAB table is defined as an XMLFILE type. If you have an XML document in your buffer, you can store it in a server file.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]