Samples > Data load utility samples
Sample: Loading initial data
This sample demonstrates how to simultaneously load top categories, subcategories, products, SKUs, attributes, and prices. This data is typically the first data to be loaded to the store.
About this sample
This sample loads the following categories:
- Men's fashions (top category)
- Women's fashions (top category)
- Pants (subcategory of Men's fashions)
- Shirts (subcategory of Men's fashions)
- Activeware (subcategory of Women's fashions)
- Accessories (subcategory of Women's fashions)
The sample also loads defining attributes, allowed values, attribute values, list prices, and offer prices. Products are created automatically when you load the SKU and attribute data.
Procedure
- Open the command-line interface and navigate to the appropriate directory:
- WC_INSTALL/bin
- WCDE_INSTALL\bin
- Enter the following command for a non-ATP store:
- ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload.xml
- dataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload.xml
Alternatively for an ATP store, enter the following command:
- ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-ATP.xml
- dataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-ATP.xml
Verify results
The wc-dataload.xml configuration file calls the wc-loader-catalog-group.xml configuration file (located in the parent directory) to load the categories from the CatalogGroup.csv source file. The wc-dataload.xml file then calls the wc-loader-catalog-entry-item.xml, wc-loader-catalog-entry-offerprice.xml, and the item attributes configuration files (wc-loader-bodysuit-attribute.xml, wc-loader-casual-shirt-attribute.xml, wc-loader-cords-attribute.xml, wc-loader-dress-pants-attribute.xml, wc-loader-dress-shirt-attribute.xml) to load SKUs from the various items source files:
- BodysuitsWithAttributesPrice.csv
- CasualShirtsWithAttributesPrice.csv
- CordsWithAttributesPrice.csv
- DressPantsWithAttributesPrice.csv
- DressShirtsWithAttributesPrice.csv
- ItemsWithAttributesPrice.csv
Verify that the data is loaded by running the following SQL statements:
- To return all categories that were loaded, enter:
select * from catgroup where identifier in ('Mens Fashions','Womens Fashions','Pants','Shirts','Activewear','Accessory')
- To return a product with the part number 'Cords' and the associated SKUs, enter:
select * from catentry where partnumber like 'Cords%'
- To return the attributes and values of the SKU with the part number 'Cords-Black-29W x 28L', enter:
select * from attrvalue where catentry_id in (select catentry_id from catentry where partnumber ='Cords-Black-29W x 28L')
- To return the offer price of the SKU with the part number 'Cords-Black-29W x 28L' , enter:
select * from offerprice where offer_id in (select offer_id from offer where catentry_id = (select catentry_id from catentry where partnumber ='Cords-Black-29W x 28L'))
You can also verify the load by viewing the data in the Management Center or in the storefront.
Update the data
After loading the sample data, you can update the data by changing the content of the CSV files and running the sample again. You can also update the data by logging in to the Management Center and using the Catalogs tool.
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: Setting up the data load utility
Next topic: Sample: Updating SKU inventory
Related reference