Load utility

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

Load Syntax Diagram

Notes:

  1. Run the massload utility. For information about configuring the Loader package refer to the topic, Configuring Loader package utilities.
  2. Filenames specified as parameters for this utility can be preceded by relative or absolute paths.

Parameter values

-dbname
AIXLinuxSun Solaris Operating EnvironmentWindowsName of the target database
i5/OSiSeriesThis is the database name as displayed in the relational database directory (WRKRDBDIRE)
-dbuser
AIXLinuxSun Solaris Operating EnvironmentWindowsName of the user connecting to the database
i5/OSiSeriesThis 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 (DB2 Load or SQLLoad). 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.
i5/OSiSeries 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. This method is not available with Oracle.
i5/OSiSeries 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. This method uses Java Database Connectivity (JDBC) to insert and update data. It allows column-level update.Note: SQL import method is the safest method to use because it will not corrupt your database if the data is invalid. Before you can load using SQL import, the records must meet the database schema constraints. The other Loader methods are faster because they are bulk loaded into the database without much checking. As a result you must be certain of data correctness before using the other methods.
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 utility (That is your working directory); therefore, your working directory must be writable.

i5/OSiSeries 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 utility 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 utility 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 utility 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 utility 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 EnvironmentWindowsMassLoadCustomizer.properties
i5/OSiSeriesISeries_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

i5/OSiSeries

-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 utility, the utility 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 utility uses the value specified. If neither a command-line nor a property-file specification for this parameter exists, the utility defaults to the schema name of the KEYS table in the database. i5/OSiSeries If neither a command-line nor a property-file specification for the -schemaname parameter exists, the utility defaults to the value of the -dbuser parameter.

Feedback