/**Begin D:\pdm\PDM_UPGRADE\pdm_new\RIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_RIM_INV_TRAIN_ELE', 'T_RIM_INV_TRAIN_ELE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TRAIN_ELE') CREATE UNIQUE  CLUSTERED INDEX IDX_RIM_INV_TRAIN_ELE ON T_RIM_INV_TRAIN_ELE ( FINVOICE_NO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TRAIN_ELEORG') CREATE INDEX IDX_RIM_INV_TRAIN_ELEORG ON T_RIM_INV_TRAIN_ELE ( FORG_ID ,FINVOICE_DATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_TRAIN_ELE2') CREATE UNIQUE INDEX IDX_RIM_INV_TRAIN_ELE2 ON T_RIM_INV_TRAIN_ELE ( FSERIAL_NO );


 EXEC P_ALTERPK 'PK_RIM_INV_AIR_ELE', 'T_RIM_INV_AIR_ELE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_AIR_ELE') CREATE UNIQUE  CLUSTERED INDEX IDX_RIM_INV_AIR_ELE ON T_RIM_INV_AIR_ELE ( FINVOICE_NO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_AIR_ELE2') CREATE UNIQUE INDEX IDX_RIM_INV_AIR_ELE2 ON T_RIM_INV_AIR_ELE ( FSERIAL_NO );


 EXEC P_ALTERPK 'PK_RIM_INV_AIR_ELE_ITEM', 'T_RIM_INV_AIR_ELE_ITEM', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_AIR_ELE_ITEM') CREATE  CLUSTERED INDEX IDX_RIM_INV_AIR_ELE_ITEM ON T_RIM_INV_AIR_ELE_ITEM ( FID );



/**End D:\pdm\PDM_UPGRADE\pdm_new\RIM_constraint.sql **/
