Previous Topic

xmlimport Command—Import XML Data into Ingres

The xmlimport utility imports into the Ingres database any XML data file containing Ingres table data that conforms to Ingres dtd.

This utility is useful to import an XML file generated by genxml into an Ingres database.

You can have several table definitions and index definitions in the XML file. When xmlimport runs, the tables and indexes specified in the XML file are created in the provided database, and the data is uploaded.

Internally, xmlimport parses the XML file to generate an SQL script from the metadata information in the XML file and for the data files for each table's data. The xmlimport utility then runs the SQL script to create tables and upload the data from the data files. Files are created in the temp directory and deleted when the script has been run, except when the -debug flag is specified.

The xmlimport command has the following format:

xmlimport dbname [uuser] [P] [-GgroupID] [-debug] xmlfile

The xmlimport utility validates the XML file against the generic Ingres dtd. If the ingres dtd is External, it should by default be at the same location as the XML file. If Ingres is referred to the ingres.dtd in the $II_SYSTEM/ingres/files area, the dtd should be present in the $II_SYSTEM/ingres/files directory.

If the tables and indexes are already in the database, an error displays and the data is appended to the existing table.

Previous Topic

xmlimport Example

This command imports an XML file named xmlout.xml into an Ingres database testdb:

xmlimport testdb xmlout.xml.

The xmlimport utility parses xmlout.xml and then creates the tables and indexes defined in the xmlout.xml file in testdb database.


© 2007 Ingres Corporation. All rights reserved.