Example: Deleting expected inventory detail

We can delete expected inventory detail data using the Data Load utility. This example uses a CSV file to demonstrate how to delete your expected inventory detail information.

This example uses a CSV file to demonstrate how to insert, replace, or delete your data. We can also create and use an XML formatted file to insert, replace, or delete your data. If you choose to create and use an XML formatted file, ensure that your XML elements use the same names as are used for CSV column names.

We can use the Data Load utility to delete data from the RADETAIL table.

CSV file with sample data

In this example the data source is a CSV file named radetail_delete.csv. The file contains sample data with minimum columns that are necessary for "delete" dataLoadMode.

CSV file with sample data

VendorName RACreateTime PartNumber ExpectedDate CatEntryStoreIdentifier
MyCompany 2005-07-12 01:01:01.123456 FULO-0101 2005-12-08 00:00:00.0 10701
AdvancedB2BDirect Vendor 2008-05-15 04:04:04.0 FULO-0201 2008-12-24 00:00:00.0
AdvancedB2BDirect Vendor 2009-05-21 00:00:00.0 FULO-0301 2009-12-31 00:00:00.0

Note: If "markForDelete" property is set as true in business object configuration file, the RADETAIL record is not deleted from database, MARKFORDELETE value of the record is updated to "1" instead. Any value other than true automatically defaults to false.


CSV column and XML element definitions

Other optional fields not included in the example include:


Business context data

The following code snippet from the wc-dataload-env.XML configuration file provides the business context data necessary for loading the data:


Mapping data

The following snippet from the sample configuration file demonstrates how to map each column of data in the source CSV file to a value. Each column in the CSV file must have such a definition. If the optional fields are present in the CSV file, the definition for them must be added.

The following snippet from the sample configuration file demonstrates how to map each column of the data in the CSV file to a business object logical schema path. The attribute 'value' represents the name of a column of the CSV file that is defined in the preceding configuration snippet. Each column in the CSV file must have a mapping to the logical schema path. If the optional fields specified are present in the CSV file, the mapping for them must be added.


Business object mediator

The mediator class name is com.ibm.commerce.inventory.dataload.mediator.ExpectedInventoryDetailMediator.

Note: When we use a mediator that is provided with WebSphere Commerce with the Data Load utility, the utility assumes that we are loading data for all columns for a business object. To update the data in only specific columns, configure a column exclusion list for the load process. A column exclusion list causes the Data Load utility to ignore specific columns during the load operation. If you do not use a column exclusion list, the utility updates all columns in the row of a database table row when the utility updates the row. If no value is set in the input file, the utility can replace the existing column value with a default value or set the value to be null. See Configure a column exclusion list.