/**Begin D:\PDM_UPGRADE\PDM1\IM_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_INVADVICE' AND KSQL_INDNAME = 'IDX_INVADVICE_FCALCULNUM') CREATE INDEX IDX_INVADVICE_FCALCULNUM ON T_IM_INVADVICE ( FCALCULATENUM );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_BALINV_MATCHDETAIL' AND KSQL_INDNAME = 'IDX_BAL_MATCH_FCALCULNUM') CREATE INDEX IDX_BAL_MATCH_FCALCULNUM ON T_IM_BALINV_MATCHDETAIL ( FCALCULATENUM );

 EXEC P_ALTERPK 'PK_T_IM_INV_WORKBENCHLOG', 'T_IM_INV_WORKBENCHLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_INV_WORKBENCHLOG' AND KSQL_INDNAME = 'IDX_IM_INV_USER_ORG_SCH') CREATE INDEX IDX_IM_INV_USER_ORG_SCH ON T_IM_INV_WORKBENCHLOG ( FUSERID ,FBALANCEORGID ,FSCHEMEID );



/**End D:\PDM_UPGRADE\PDM1\IM_constraint.sql **/
