Sample: Updating SKU inventory

This sample demonstrates how to update inventory quantities for the SKUs that have already been loaded to your database.

Restriction: Inventory quantities cannot be viewed in the Management Center. If you are using the Catalogs tool in the Management Center, you must verify the inventory quantities by using the SQL statements provided.

About this sample

This sample updates the inventory quantity of the SKU with the part number 'Cords-Black-29W x 28' to 200.


Before running this sample, ensure that you have loaded the initial data.

  1. HCL Commerce DeveloperOn a command line, go to the WCDE_installdir\bin directory.
  2. LinuxOpen a command line in the . Change the directory to utilities_root/bin directory. For information about entering and leaving containers, see Running utilities from the Utility server Docker container.
  3. Enter the following command:
    • Linux./ ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-nonATP-inventory.xml
    • HCL Commerce Developerdataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-nonATP-inventory.xml
    Alternatively for an ATP store, run data load by using wc-dataload-ATP-inventory.XML.
    • Linux./ ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-ATP-inventory.XML
    • HCL Commerce Developerdataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-ATP-inventory.XML

Verifying results

The wc-dataload-nonATP-inventory.xml configuration file updates the inventory quantities for the SKUs loaded in the initial load sample. Verify that the inventory data is loaded by looking at the INVENTORY table:
  • To return the inventory quantity for the SKU with the part number 'Cords-Black-29W x 28', enter:
    select * from inventory where catentry_id = (select catentry_id from catentry where 
    partnumber ='Cords-Black-29W x 28L')
    The inventory quantity returned should be 200.
Alternatively for an ATP store to see how a particular store allocates inventory for the SKU with part number 'Cords-Black-29W x 28' enter:
select TrackInventory, BackOrderable, ReleaseSeparately, Creditable, ForceBackorder, 
ReturnNotDesired, PickingMethod, Discontinued, MinQTYForSplit, QuantityMeasure, 
QuantityMultiple from baseitem b, itemspc i, storeitem s, distarrang d where b.baseitem_id=i.baseitem_id 
and b.baseitem_id=s.baseitem_id and b.baseitem_id=d.baseitem_id and i.partnumber='Cords-Black-29W x 28L'

Cleaning up the data

To remove the data that is 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.