Command Reference Guide > Command Reference Guide > Using Ingres Commands > xmlimport Command--Import XML Data into Ingres
Was this helpful?
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 (see genxml Command--Export Tables Into XML Format) 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
dbname
Specifies the name of the database being imported, and if required, the vnode and server_class, as described in Standard Flags and Parameters.
-uuser
Specifies the effective user for the session, as described in Standard Flags and Parameters.
-P
Specifies the password for the session, if required.
-Ggroupid
Specifies a group identifier, as described in Standard Flags and Parameters.
-debug
Leaves the generated XML file and the data files in the temp location. By default, the files in this location are deleted.
xmlfile
Specifies the name of the XML file that needs to be imported into the database.
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.
Last modified date: 08/29/2024