Managing the KEYS table for non-sequential key enabled tables

HCL Commerce provides data load utilities to load data. If you are using a custom utility to load data into HCL 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 HCL 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:
    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.