Export_to_XML

SQL

PROCEDURE Export_to_XML(INOUT dad_ref CLOB, INOUT fname CHAR(255));


Parameters

dad_ref
reference to DAD
fname
name of the XML file


Since version

8.1

Description

This function will export XML data specified in the DAD to the specified file name fname. In the case of an analytic DAD, the data source is always fixed in the DAD description (curs = -1). In the case of a synthetic DAD, you may use the DAD description (curs = -1) or use your own cursor from the same structure (set the curs number to that cursor).

The dad_ref parameter may have two forms. If it is in the object_name prefixed with an asterisk (*object_name), the DAD will search the current opened application for a transfer type object, otherwise it is read from the specified variable.

The 602xml extension must be loaded in order to export to XML. It is required to prefix the function name with extension name (CALL `602xml`.Export_to_XML). You must load the extension in advance on Linux (before compilation) with the following command:

CALL load_server_extension('602xml')



Example

Export data in XML format to the specified file (SQL procedure):

PROCEDURE `exp_xml`();
BEGIN
  DECLARE dad CLOB;
  DECLARE fname CHAR(255);
   
  SET dad ="*temp_dad";
  SET fname = "c:\temp\file1.xml";
  
  CALL `602xml`.Export_to_XML(dad,fname);
END

Viz