Load command

This command loads an XML input file into a target database.

AIXiSeriesLinuxSun Solaris Operating Environment

Load Syntax Diagram

Notes:

  1. The above diagram is intended primarily as a reference for the command parameters. The command file or script provided for this command and listed in Configuring Loader package commands and scripts acts as a wrapper to the actual Java command and accepts the same parameters; therefore, it is recommended that you use the command file or script rather than invoke the Java command directly.
  2. Filenames specified as parameters for this command can be preceded by relative or absolute paths.

Parameter values

-dbname
AIXLinuxSun Solaris Operating EnvironmentName of the target database
iSeriesThis is the database name as displayed in the relational database directory (WRKRDBDIRE)
-dbuser
AIXLinuxSun Solaris Operating EnvironmentName of the user connecting to the database
 
iSeriesThis is usually the same as the instance user name
-dbpwd
Password for the user connecting to the database
-infile
Name of the input XML file
-directory
You use the -infile parameter if you are using any option other than loadonly for the -method parameter as described below. If you use the loadonly method, you must replace the -infile parameter with the -directory parameter or an error will result. For the value of the -directory parameter when you use the loadonly method, you specify the fully qualified path of the MassLoadOutputFiles directory that was created using the createonly method as described below.
-method
Mode of operation for the Loader to use when modifying the database using input data
load
The load method uses the native loader from the database vendor. You can use the load method for both local and remote Oracle databases; but the load method can only be used for local DB2 databases.

iSeries The load method does not support bit data or DBCLOB fields.

import
The import method uses the import or update option if it is available from the database vendor. If the import or update option is not available, SQL statements using JDBC are used to update the database. The default is import.

iSeries The import method can only be used on local databases and does not support bit data or DBCLOB fields.

sqlimport
The SQL import (sqlimport) method can be used with both local and remote databases.
delete
The delete method deletes data from the database. If you are using Product Advisor search-space synchronization, you must use either the sqlimport or the delete method.
createonly
To improve performance during instance creation, use the createonly method. Use the createonly method to create mass-load data (MLD) files without loading the data into the database. The files that are created when you use this method (.mld and .cmd files) are placed in a directory named "MassLoadOutputFiles." This directory is created as a subdirectory under the directory from which you run the Load command (That is your working directory); therefore, your working directory must be writable.

iSeries When creating an instance, the MassLoadOutputFiles directory is created as a subdirectory of the temp directory, under the instance's root directory. The default location of the directory will be WC_userdir/instances/instance_name/temp/MassLoadOutputFiles

Here is an example of running the Load command using the createonly method:

AIXLinuxSun Solaris Operating Environment

./massload.sh -dbname mall -dbuser db2admin -dbpwd db2admin -infile 
WC_installdir\data\example.xml -method createonly

You can later use your native database load utility to load the MLD files that you created into a WebSphere Commerce database by running the Load command using the loadonly method described below.

Note: The program obtains information about the native database load utility that your database product uses from the customizer property file.

loadonly
Use the loadonly method to load MLD files that were created using the createonly method described above. When you use the loadonly method, you must also use the -directory parameter or an error will result.

Note: The -directory parameter replaces the -infile parameter that you would specify if you were using any method other than loadonly.

For the value of the -directory parameter, you must specify the fully qualified path of the MassLoadOutputFiles directory that was created using the createonly method.

Here is an example of running the Load command using the loadonly method (and the required -directory parameter) :

AIXLinuxSun Solaris Operating Environment

./massload.sh -dbname mall -dbuser db2admin -dbpwd db2admin -method
loadonly -directory WC_installdir\bin\MassLoadOutputFiles
-schemaname wcsadmin

Always specify the name of the target database schema using the -schemaname parameter when you run the Load command using this method. Otherwise, the program uses the name of the database schema obtained when the MassLoadOutputFiles directory and its files were originally created.

When you use the loadonly method, errors and other messages are saved in files that have a .log extension. These log files are written to the MassLoadOutputFiles directory specified for the -directory parameter.

Use the loadonly method only for instance creation. If you use it at any other time, the result may not be desirable.

-noprimary
Action the Loader must take when the primary key is missing for a record in the input file. The error option indicates that it should report the missing primary key as an error and terminate. The skip option skips any record in the input file that does not have a primary key. The insert option tries to process (insert or delete) the data. The default action is error.
-commitcount
Number of records processed before the database commit occurs when using the SQL update method of operation. The default number is 1.
-maxerror
Number of errors after which the Loader will terminate in the SQL update method of operation. This parameter is optional. The default is 1.
-customizer
Name of the customizer property file to be used. The default file is:

AIXLinuxSun Solaris Operating EnvironmentMassLoadCustomizer.properties
iSeriesISeries_LODWCSDTA_Customizer.properties
If you have configured your instance to use the toolbox driver, then use the Toolbox_LODWCSDTA_Customizer customizer file provided for the toolbox driver. You must also specify the hostname for the -dbname parameter. The following is an example of invoking the massload.sh script:

./massload.sh -dbname MY.HOSTNAME.CA -dbuser instance -dbpwd mypass -method sqlimport
-customizer Toolbox_LODWCSDTA_Customizer -infile /path/file.xml

The customizer property file can be specified as shown in the following example:
 

 AIXLinuxSun Solaris Operating Environment

-customizerWC_installdir/my_directory/file_name.properties

-customizerWC_installdir/my_directory/file_name

iSeries

-customizerWC_userdir/my_directory/file_name.properties

-customizerWC_userdir/my_directory/file_name

If this file exists in the current directory, the same file can be specified as shown in the following example:

  -customizer file_name.properties

If this file exists in a directory specified in the classpath system-environment variable, the same file can be specified as shown in the following example:

  -customizer file_name

where, my_directory is a user defined directory and file_name is the name of the property file that you want to use.

-schemaname
Name of the target database schema. This parameter is optional. If this parameter is not specified when running the command, the command looks for a name=value pair in the customizer property file that specifies the value of SchemaName. If this pair is present in the property file, the command uses the value specified. If neither a command-line nor a property-file specification for this parameter exists, the command defaults to the schema name of the KEYS table in the database. iSeries If neither a command-line nor a property-file specification for the -schemaname parameter exists, the command defaults to the value of the -dbuser parameter.

Windows

Load Syntax Diagram

Parameter values

-dbname
Name of the target database

 
-dbuser
Name of the user connecting to the database
 
-dbpwd
Password for the user connecting to the database
-infile
Name of the input XML file
-directory
You use the -infile parameter if you are using any option other than loadonly for the -method parameter as described below. If you use the loadonly method, you must replace the -infile parameter with the -directory parameter or an error will result. For the value of the -directory parameter when you use the loadonly method, you specify the fully qualified path of the MassLoadOutputFiles directory that was created using the createonly method as described below.
-method
Mode of operation for the Loader to use when modifying the database using input data
load
The load method uses the native loader from the database vendor. You can use the load method for both local and remote Oracle databases; but the load method can only be used for local DB2 databases. Although the import method can be used to load data into local or remote databases, it is usually used to load data into remote DB2 databases.
import
The import method uses the import or update option if it is available from the database vendor. If the import or update option is not available, SQL statements using JDBC are used to update the database. The default is import.
sqlimport
The SQL import (sqlimport) method can be used with both local and remote databases.
delete
The delete method deletes data from the database. If you are using Product Advisor search-space synchronization, you must use either the sqlimport or the delete method.
createonly
To improve performance during instance creation, use the createonly method. Use the createonly method to create mass-load data (MLD) files without loading the data into the database. The files that are created when you use this method (.mld and .cmd files) are placed in a directory named "MassLoadOutputFiles." This directory is created as a subdirectory under the directory from which you run the Load command (i.e., your working directory); therefore, your working directory must be writable. Here is an example of running the Load command using the createonly method :
 massload -dbname mall -dbuser db2admin -dbpwd db2admin -infile 
WC_installdir\data\example.xml -method createonly

You can later use your native database load utility to load the MLD files that you created into a WebSphere Commerce database by running the Load command using the loadonly method described below.

Note: The program obtains information about the native database load utility that your database product uses from the customizer property file.

loadonly
Use the loadonly method to load MLD files that were created using the createonly method described above. When you use the loadonly method, you must also use the -directory parameter or an error will result.

Note: The -directory parameter replaces the -infile parameter that you would specify if you were using any method other than loadonly.

For the value of the -directory parameter, you must specify the fully qualified path of the MassLoadOutputFiles directory that was created using the createonly method.

Here is an example of running the Load command using the loadonly method (and the required -directory parameter) :

massload -dbname mall -dbuser db2admin -dbpwd db2admin -method
loadonly -directory WC_installdir\bin\MassLoadOutputFiles
-schemaname wcsadmin

Always specify the name of the target database schema using the -schemaname parameter when you run the Load command using this method. Otherwise, the program uses the name of the database schema obtained when the MassLoadOutputFiles directory and its files were originally created.

When you use the loadonly method, errors and other messages are saved in files that have a .log extension. These log files are written to the MassLoadOutputFiles directory specified for the -directory parameter.

Use the loadonly method only for instance creation. If you use it at any other time, the result may not be desirable.

-noprimary
Action the Loader must take when the primary key is missing for a record in the input file. The error option indicates that it should report the missing primary key as an error and terminate. The skip option skips any record in the input file that does not have a primary key. The insert option tries to process (insert or delete) the data. The default action is error.
-commitcount
Number of records processed before the database commit occurs when using the SQL update method of operation. The default number is 1.
-maxerror
Number of errors after which the Loader will terminate in the SQL update method of operation. This parameter is optional. The default is 1.
-customizer
Name of the customizer property file to be used. The default file is:
MassLoadCustomizer.properties
 

The customizer property file can be specified as shown in the following example:-customizerWC_installdir\my_directory\file_name.properties

If this file exists in a directory specified in the classpath system-environment variable, the same file can be specified as shown in the following example:

  -customizer file_name

where, my_directory is a user defined directory and file_name is the name of the property file that you want to use.

-schemaname
Name of the target database schema. This parameter is optional. If this parameter is not specified when running the command, the command looks for a name=value pair in the customizer property file that specifies the value of SchemaName. If this pair is present in the property file, the command uses the value specified. If neither a command-line nor a property-file specification for this parameter exists, the command defaults to the schema name of the KEYS table in the database.