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]
Specifies the name of the database being exported. Also specifies the vnode and server_class, if required, as described in Standard Flags and Parameters.
Specifies the effective user for the session, as described in Standard Flags and Parameters.
Specifies the password if the session requires one.
Specifies a group identifier, as described in Standard Flags and Parameters.
Specifies the destination directory into which the XML file is generated. An empty dirname specification (".") denotes the current directory. The generated Ingres DTD is also placed in this directory.
Specifies the name of the output XML file. By default, the file is called xmlout.xml.
Specifies the name of the output dtd file. By default, the file is called ingres.dtd.
Indicates to print the metadata information only.
Prints the DTD inline inside the XML doc.
Places a reference to the ingres.dtd in Ingres files directory ($II_SYSTEM/ingres/files).
Specifies the table name or names that the user wants the XML to output. Table names must be separated by spaces. If omitted, all tables are copied. The table name can be qualified with a valid schema name in the format schema.tablename, as described in Schema Qualifier.
Note: No more than 100 objects can be specified. This limit can be raised by modifying the utexe.def file. For more information, see the Database Administrator Guide.
Changes the doctype or the document name of the XML file. The default doctype is IngresDoc. Use this flag with caution. If the document name is changed, the referred_dtd option should not be used because the referred generic Ingres DTD in $II_SYSTEM/ingres/files has IngresDoc as document type.
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.