IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_ORDERMERGE' AND KSQL_COL_NAME ='fmergeorderid') 
ALTER TABLE T_POM_ORDERMERGE ADD (fmergeorderid BIGINT DEFAULT 0 NOT NULL );

 
  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_MGO_orderid') CREATE INDEX IDX_POM_MGO_orderid ON T_POM_ORDERMERGE ( fmergeorderid );