/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_constraint.sql **/
 EXEC P_ALTERPK 'PK_IM_MDC_MFTOMREQBILL', 'T_IM_MDC_MFTOMREQBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_MDC_MFTOMREQBILL' AND KSQL_INDNAME = 'IDX_IM_MDC_MFTOMREQBILL_FNO') CREATE INDEX IDX_IM_MDC_MFTOMREQBILL_FNO ON T_IM_MDC_MFTOMREQBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_MDC_MFTOMREQBILL' AND KSQL_INDNAME = 'IDX_IM_MDC_MFTOMREQBILL_FCTIME') CREATE INDEX IDX_IM_MDC_MFTOMREQBILL_FCTIME ON T_IM_MDC_MFTOMREQBILL ( FCREATETIME );


 EXEC P_ALTERPK 'PK_IM_MDC_MFTOMREQBILL_L', 'T_IM_MDC_MFTOMREQBILL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_MDC_MFTOMREQBILL_L' AND KSQL_INDNAME = 'IDX_IM_MDC_MFTOMREQBILL_L_FID') CREATE INDEX IDX_IM_MDC_MFTOMREQBILL_L_FID ON T_IM_MDC_MFTOMREQBILL_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_MDC_MFTOMREQBILL_L' AND KSQL_INDNAME = 'IDX_IM_MDC_MFTOMREQBILL_L_FCOM') CREATE INDEX IDX_IM_MDC_MFTOMREQBILL_L_FCOM ON T_IM_MDC_MFTOMREQBILL_L ( FCOMMENT );


 EXEC P_ALTERPK 'PK_IM_MDC_MFTOMREQENTRY', 'T_IM_MDC_MFTOMREQENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_MDC_MFTOMREQENTRY' AND KSQL_INDNAME = 'IDX_IM_MDC_MFTOMREQENTRY_FID') CREATE INDEX IDX_IM_MDC_MFTOMREQENTRY_FID ON T_IM_MDC_MFTOMREQENTRY ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_MDC_MFTOMREQENTRY' AND KSQL_INDNAME = 'IDX_IM_MDC_MFTOMREQENTRY_FSEQ') CREATE INDEX IDX_IM_MDC_MFTOMREQENTRY_FSEQ ON T_IM_MDC_MFTOMREQENTRY ( FSEQ );



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