idresgen utility

The idresgen utility generates identifiers for XML elements with their associated identifiers. The XML files must have identifiers because the XML files map directly to the target database schema.

AIX|I5/OS|Linux|Solaris|Windows:

The page covers the idresgen utility in the WebSphere Commerce development environment. For the idresgen utility in the WebSphere Commerce server environment, see idresgen utility (Server environment).

If your XML content already supplies identifiers, you do not have to run the idresgen utility.

The idresgen utility includes an error reporter that generates a log file if there is an error. The following are examples of situations in which you might want to use the idresgen utility:

The idresgen utility can supply actual identifiers, or identifiers can be resolved using the following techniques:

Internal-alias resolution

To use internal-alias resolution with the idresgen utility, an alias is placed in the primary-key attribute (identifier) in the XML file. The alias can then be used throughout the XML file to refer to that element. This process eliminates the need for a program to determine the unique indexes necessary to build the XML file.

Properties-file specification

The idresgen utility in the loading utilities can use a Java properties file to determine which columns of a primary table should be used as lookups for tables that require the identifier of a primary table. A table is primary if it is listed in the KEYS or SUBKEYS table.

Unique-index resolution

In the idresgen utility, unique-index resolution uses any specified unique indexes on a table as a means of determining an identifier. For example, MEMBER_ID plus IDENTIFIER is a unique index on the CATALOG table and can therefore be used as a resolution point to the primary key CATALOG_ID of the CATALOGDSC table.

The idresgen utility can analyze the database schema to determine whether there is a unique index that fulfills its requirements. The idresgen utility looks for a unique index only when there is no entry in the properties file for the table being analyzed or when there is no properties file. If these conditions are true, a unique-index check is performed. The unique index is considered valid if it exists and does not include the primary key for the table.

Before running this utility, ensure that you have complete the required configuration tasks:

  1. Configure the environment variable setting scripts.

  2. Configure tracing and logging for the loading utilities.

  3. Configure the idresgen utility.

Filenames specified as parameters for this utility can be preceded by relative or absolute paths. Relative paths must be relative to the directory from which you run the idresgen utility.

Important: The wcs.dtd file must be in the same directory as the infile XML file.

 

Syntax

The syntax for the idresgen utility depends on which database you are using as the development database:

Parameter values

Input XML file

Name of the input XML document containing table records. The wcs.dtd file must be in the same directory as the XML file.

Output XML file

Name of the output XML file to be produced. This file can be used as input to the massload utility.

I5/OS: Host name

The fully qualified host name of the machine hosting the development database.

DB name

The name of the database into which you are loading data.

DB user

The ID of a database user authorized to connect to the database.

DB pwd

The password for the database user.

DB schema

(Optional) The name of the database schema into which you are loading data. Specify the schema name in upper case letters.

Properties file

(Optional) The full path to a text file containing Java properties in the form of name/value pairs. This file is used to define the look-aside column names for foreign-key identifier lookup and the select predicate for main table (such as CATEGORY and PRODUCT) queries. You can omit entries in this file for tables that have a unique index defined that does not include the identifier.

If you do not specify this parameter, the default file is used. The default file is WCDE_installdir/properties/IdResolveKeys.properties.

Related concepts

Load utilities
Transforming, loading, and extracting data using the WebSphere Commerce loading utilities

Related tasks

Configure the environment variable setting scripts
Configure the idresgen utility
Resolving identifiers
Specifying a properties file with the idresgen utility
Create an XML file to use internal-alias ID resolution

Related reference

Resolving identifiers for records that share identifiers with existing data
dtdgen utility
massextract utility
massload utility
massload utility (Server environment)
txttransform utility
xmltransform utility