/**Begin D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_RIM_INV_ELECTRIC', 'T_RIM_INV_ELECTRIC', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_ELECTRIC_SERIAL') CREATE  CLUSTERED INDEX IDX_RIM_INV_ELECTRIC_SERIAL ON T_RIM_INV_ELECTRIC ( FSERIAL_NO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_ELECTRIC_NO') CREATE UNIQUE INDEX IDX_RIM_INV_ELECTRIC_NO ON T_RIM_INV_ELECTRIC ( FINVOICE_NO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_ELECTRIC_TAXORG') CREATE INDEX IDX_RIM_INV_ELECTRIC_TAXORG ON T_RIM_INV_ELECTRIC ( FTAX_ORG );


 EXEC P_ALTERPK 'PK_T_RIM_INV_ELECTRIC_ITEM', 'T_RIM_INV_ELECTRIC_ITEM', 'FENTRYID', '0';

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



/**End D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_constraint.sql **/
