/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
 EXEC P_ALTERPK 'PK_IM_LOTINTRACK', 'T_IM_LOTINTRACK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_LOTTRACK_FLOTNUMBER') CREATE INDEX IDX_IM_LOTTRACK_FLOTNUMBER ON T_IM_LOTINTRACK ( FLOTNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_LOTTRACK_FBIZTIME') CREATE INDEX IDX_IM_LOTTRACK_FBIZTIME ON T_IM_LOTINTRACK ( FBIZTIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_LOTTRACK_FEXPIRYDATE') CREATE INDEX IDX_IM_LOTTRACK_FEXPIRYDATE ON T_IM_LOTINTRACK ( FEXPIRYDATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_LOTTRACK_ORG_ML_PDATE') CREATE INDEX IDX_IM_LOTTRACK_ORG_ML_PDATE ON T_IM_LOTINTRACK ( FORGID ,FMATERIALID ,FPRODUCEDATE );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
