Previous Topic Next topic Print topic


LOAD DATATABLE

Either loads a DataTable from an XML file, or uses a cursor to load a DataTable. Also provides addressability to the corresponding ADO.NET DataTable.

Syntax:

>>--EXEC ADO-.--------------------.-LOAD DATATABLE datatable_name FROM------------------->
             +-USING dataset_name-+

 >-+xml_file_spec+-.-------------------.--.----------------------.--->
   +cursor_name  + |                   |  |                      |
                   +-WITH SCHEMA CHECK-+  +-RETURNING :dt_obj_hv-+
 
 >--END-EXEC----><

Parameters:

dataset_name The name of the DataSet to be used, or – (dash), which specifies a standalone DataSet. If you do not specify dataset_name, the current DataSet is used.
datatable_name The DataTable reference to be used.
xml_file_spec Location of the XML file that contains the DataTable’s schema and data.
cursor_name The name of a cursor that should be used to load data into a DataTable.
WITH SCHEMA CHECK Verifies that the DECLARE DATATABLE used at compile time matches the one stored in the XML file.
dt_obj_hv Host variable where the DataTable object is placed.

Comments:

When using the cursor_name option, the cursor must be open when the LOAD DATATABLE FROM CURSOR statement is executed, and should be closed after it has executed.

Examples:

     EXEC ADO  
        LOAD DATATABLE TABLE1 FROM "C:\DATA\EMPLOYEE.XML" 
        WITH SCHEMA CHECK RETURNING :DATATBL-OBJ  
     END-EXEC

     EXEC ADO  
        LOAD DATATABLE TABLE1 FROM CURSOR C1
     END-EXEC
Previous Topic Next topic Print topic