Samples > Data load utility samples
Sample: Loading classic attributes, attribute values, and allowed values
This sample demonstrates how to load classic attributes together with the associated allowed values and attribute values in a single load operation. If you are using classic attributes, use this sample. If you are using the attribute dictionary, use the sample Load attribute dictionary data.
About this sample
Part numbers, attributes, and attribute values loaded in this sample.
Attribute Identifier Attribute type Attribute Value 1 Attribute Value 2 CordsColor Define attribute Black Brown CordsSize Define attribute 29W x 28L DressPantColor Define attribute Black Blue DressPantSize Define attribute 29W x 32L DressShirtColor Define attribute White DressShirtSize Define attribute 15 16 CasualShirtColor Define attribute White Blue CasualShirtSize Define attribute Small Medium BodysuitColor Define attribute Black BodysuitSize Define attribute Petit
Procedure
- Open the command-line interface and navigate to the appropriate directory:
- WC_INSTALL/bin
- WCDE_INSTALL\bin
- Load the products and SKUS:
For non-ATP store:
- ./dataload.sh ../samples/DataLoad/Catalog/wc-dataload-catalog-entry.xml
- dataload ..\samples\DataLoad\Catalog\wc-dataload-catalog-entry.xml
For ATP store:
- ./dataload.sh ../samples/DataLoad/Catalog/wc-dataload-ATP-catalog-entry.xml
- dataload ..\samples\DataLoad\Catalog\wc-dataload-ATP-catalog-entry.xml
- Load attributes, allowed values, and specific values for the SKUs:
- ./dataload.sh ../samples/DataLoad/Catalog/CatalogEntryAttribute/wc-dataload.xml
- dataload ..\samples\DataLoad\Catalog\CatalogEntryAttribute\wc-dataload.xml
Verify results
The wc-dataload.xml configuration file loads attribute data from the CatalogEntryDefiningAttributeAndAllowedValue.csv source file. The file is used to create the attributes and the range of allowed values for the products. The wc-dataload.xml file then calls the wc-loader-catalog-entry-defining-attribute-value.xml configuration file to load the specific attribute values to each SKU from the CatalogEntryDefiningAttributeValue.csv source file.Verify that the data is loaded by running the following SQL statements:
- To return all attributes loaded, enter:
select attribute_id,catentry_id,name from attribute where name in ('Color','Size') and language_id=-1 and catentry_id in (select catentry_id from catentry where partnumber like 'Cords%' or partnumber like 'Classic pleated dress pant%' or partnumber like 'Dress shirt%' or partnumber like 'Casual shirt%' or partnumber like 'Bodysuit%')
Record the range of values returned for the attribute_id field.
- To return all attribute values loaded, enter:
select attribute_id,attrvalue_id,catentry_id,name from attrvalue where attribute_id between attribute_id_range_min and attribute_id_range_maxWhere attribute_id_range_min and attribute_id_range_max are the minimum and maximum values of the attribute_id field returned in the previous SQL statement.
- To return the attributes and values of a specific SKU, enter:
select attribute_id,attrvalue_id,catentry_id,name from attrvalue where catentry_id in (select catentry_id from catentry where partnumber ='Cords-Black-29W x 28L')
You can also verify the load by viewing the attribute data 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/CatalogEntryAttribute directory.
Previous topic: Sample: Loading bundles and kits
Next topic: Sample: Changing the parent of a subcategory
Related concepts
Related reference