Samples > Data load utility samples


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:

Names and list prices of catalog entries before and after running this sample
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.

  1. Open the command-line interface, and navigate to the appropriate directory:

  2. 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


Verify 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.


Clean 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.

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.


Previous topic: Sample: Loading merchandising associations


Next topic: Sample: Loading bundles and kits

Related reference

Data load utility samples


+

Search Tips   |   Advanced Search