Sample: Replacing existing products and SKUs
This sample demonstrates how to use the data load replace mode by replacing products and SKUs previously loaded to the database.
About this sample
This sample replaces the list price and name of the product and SKU listed in the following table:Part Number | Old Name | Old List Price | New Name | New List Price |
---|---|---|---|---|
Cords | Men's corduroy pants | 30 | Men's designer corduroy pants | 35 |
Cords-Black-29W x 28L | Men's corduroy pants - Black 29W x 28L | 30 | Men's designer corduroy pants - Black 29W x 28L | 35 |
Procedure
Before running this sample, ensure that you have loaded the initial data.
- Open the command-line interface, and navigate to the appropriate
directory:
- WC_installdir/bin
- WCDE_installdir\bin
- Enter the following command:
- ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-replace-product-item.xml
- dataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-replace-product-item.xml
Verifying results
The wc-dataload-replace-product-item.xml configuration file replaces the product and SKU data loaded in the initial load sample with data in the CatalogEntries.csv source file. Verify that the data is replaced by running the following SQL statement:select catentry_id, name from catentdesc where catentry_id in
(select catentry_id from catentry where partnumber like '%Cords%')
select * from listprice where catentry_id in (select catentry_id from catentry where partnumber like
'%Cords%')
This
statement returns the names and list prices of the product and SKU being replaced by the data load.
You can also verify the load by viewing the updated list price and name in the Management Center or in the storefront.
Cleaning up the data
To remove the data loaded in this sample from the database, run the CleanUp.sql file in the /samples/DataLoad/Catalog/IntegrateScenario directory.Note: After
running the CleanUp.sql file, you might see that
0 rows are deleted for certain SQL statements. This result is expected,
as not all rows are populated with data in this sample.