Previous Topic

Next Topic

genxml Command—Export Tables Into XML Format

The genxml utility allows bulk transfer of Ingres data from an Ingres database into XML format. This allows Ingres data on the web to communicate with other third party products.

The generated XML documents refer to generic Ingres DTD (Document Type Definition). Ingres DTD is a controlled document describing the Ingres data. DTD can be internal or external.

When the genxml command is executed on an Ingres database, an XML file is generated, containing the metadata and the data for the tables in XML format, as specified by the Ingres DTD (Document Type Definition). A DTD file is also generated by genxml by default, unless other options are specified.

For external DTDs, the dtd file can be printed in the same directory as the XML file. Alternatively, external DTDs can be a referenced in the XML file to the DTD location. This location will be either a URL or a static location, such as $II_SYSTEM/ingres/files/ingres.dtd. Reference to the Ingres DTD is made using the DOCTYPE declaration in the generated XML file.

You can use the generated XML file as input to the xmlimport utility for importing into another Ingres installation. For details, see xmlimport Command.

The genxml command has the following format:

genxml dbname | vnode::dbname[/server_class] [-uuser] [-P] [-GgroupID]
[-dest=dir] [-xmlfile=filename] [-dtdfile=filename] [-metadata_only]
[-internal_dtd] [-referred_dtd] [{tablename}] [title_doctype=title]

Previous Topic

Next Topic

genxml Examples

This command generates a copy of a database testdb in XML format:

genxml testdb

The generated files "xmlout.xml" and "ingres.dtd" are written to the current directory. The file xmlout.xml contains the metadata and data of all tables in the database testdb.

The following command exports table tab1 only, writes the files to directory (/tmp/mydirectory) using file name myxml.xml, and places the DTD file inline with the XML file:

genxml testdb –dest="/tmp/mydirectory" –xmlfile=myfile.xml –internal_dtd tab1

If you want to recreate objects at any other location or installation without copying a large amount of data, you can use the -metadata_only flag to generate the metadata information in XML format.


© 2007 Ingres Corporation. All rights reserved.