Import_from_XML

SQL

PROCEDURE Import_from_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 imports data in the XML format from the specified file name fname according to the mapping specified in the DAD.

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

Import data from an XML file using the stored DAD (SQL language):

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

Viz