WebSphere Commerce Version 8.0.3.0 or later

Managing the KEYS table for non-sequential key enabled tables

WebSphere Commerce provides data load utilities to load data. If you are using a custom utility to load data into WebSphere Commerce tables, you must update the corresponding entries in the KEYS table.

About this task

The non-sequential key is enabled for ORDERS and ADDRESS tables. If you are using a custom utility to load data, update the KEYS records for ORDERS and ADDRESS table as follows.
Note: It is not required to update the KEYS table manually when you use WebSphere Commerce provided utilities to load data.

Procedure

  1. For the tables with column KEYS.nonsequential = '0', update the entries in the KEYS table.
  2. For the tables with column KEYS.nonsequential = '1', run the following SQL statements.
    For example, if you are using the ORDERS table:
    1. Oracle For Oracle database
      update keys set counter = ceil((select coalesce(max(orders_id),0) from orders where
      orders_id>=lowerbound*multiplier and orders_id<upperbound*multiplier)/multiplier) where
      tablename='orders';
      update keys set counter = lowerbound where tablename='orders' and counter = 0;
    2. DB2 For non-Oracle database
      update keys set counter = (select coalesce(max(orders_id),0) from orders where
      orders_id>=lowerbound*multiplier and orders_id<upperbound*multiplier)/multiplier+1 where
      tablename='orders';
      update keys set counter = lowerbound where tablename='orders' and counter = 0;
      Note: Do not update the LOWERBOUND or UPPERBOUND parameters.