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

 EXEC P_ALTERPK 'PK_IM_MDC_MRBCHANGELOG', 'T_IM_MDC_MRBCHANGELOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_MRL_FMFTREQENTRYF7') CREATE INDEX IDX_MDC_MRL_FMFTREQENTRYF7 ON T_IM_MDC_MRBCHANGELOG ( FMFTREQENTRYF7 );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_MRL_FXREQENTRYID') CREATE INDEX IDX_MDC_MRL_FXREQENTRYID ON T_IM_MDC_MRBCHANGELOG ( FXREQENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_MRL_FREQBILLID') CREATE INDEX IDX_MDC_MRL_FREQBILLID ON T_IM_MDC_MRBCHANGELOG ( FREQBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_MRL_FXREQBILLID') CREATE INDEX IDX_MDC_MRL_FXREQBILLID ON T_IM_MDC_MRBCHANGELOG ( FXREQBILLID );


 EXEC P_ALTERPK 'PK_IM_MDC_MRBLOGENTRY', 'T_IM_MDC_MRBLOGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_MRBLOGENTRY_FID') CREATE INDEX IDX_MDC_MRBLOGENTRY_FID ON T_IM_MDC_MRBLOGENTRY ( FID );


 EXEC P_ALTERPK 'PK_IM_MDC_XMFTREQBILLS', 'T_IM_MDC_XMFTREQBILLS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XMFTREQBILLS_FORGID') CREATE INDEX IDX_MDC_XMFTREQBILLS_FORGID ON T_IM_MDC_XMFTREQBILLS ( FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XMFTREQBILLS_FBILLNO') CREATE INDEX IDX_MDC_XMFTREQBILLS_FBILLNO ON T_IM_MDC_XMFTREQBILLS ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XMFTREQBILLS_FREQID') CREATE INDEX IDX_MDC_XMFTREQBILLS_FREQID ON T_IM_MDC_XMFTREQBILLS ( FREQBILLID );


 EXEC P_ALTERPK 'PK_IM_MDC_XMFTREQBILLS_L', 'T_IM_MDC_XMFTREQBILLS_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_XMFTREQBILLS_FID') CREATE INDEX IDX_IM_MDC_XMFTREQBILLS_FID ON T_IM_MDC_XMFTREQBILLS_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_IM_MDC_XMFTREQCONFIG', 'T_IM_MDC_XMFTREQCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XMFTREQCONFIG_FNUMBER') CREATE INDEX IDX_MDC_XMFTREQCONFIG_FNUMBER ON T_IM_MDC_XMFTREQCONFIG ( FNUMBER );


 EXEC P_ALTERPK 'PK_IM_MDC_XMRCENTRY', 'T_IM_MDC_XMRCENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XMRCENTRY_FID') CREATE INDEX IDX_MDC_XMRCENTRY_FID ON T_IM_MDC_XMRCENTRY ( FID );


 EXEC P_ALTERPK 'PK_IM_MDC_XMFTREQCONFIG_L', 'T_IM_MDC_XMFTREQCONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_XMFTREQCONFIG_FID') CREATE INDEX IDX_IM_MDC_XMFTREQCONFIG_FID ON T_IM_MDC_XMFTREQCONFIG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_IM_MDC_XMFTREQENTRY', 'T_IM_MDC_XMFTREQENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XREQ_FMATERMASTERID') CREATE INDEX IDX_MDC_XREQ_FMATERMASTERID ON T_IM_MDC_XMFTREQENTRY ( FMATERIELMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XREQ_FMAINBILLID') CREATE INDEX IDX_MDC_XREQ_FMAINBILLID ON T_IM_MDC_XMFTREQENTRY ( FMAINBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XREQ_FMAINBILLENTRYID') CREATE INDEX IDX_MDC_XREQ_FMAINBILLENTRYID ON T_IM_MDC_XMFTREQENTRY ( FMAINBILLENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XREQ_FID') CREATE INDEX IDX_MDC_XREQ_FID ON T_IM_MDC_XMFTREQENTRY ( FID );


 EXEC P_ALTERPK 'PK_IM_MDC_XMFTREQENTRY_X', 'T_IM_MDC_XMFTREQENTRY_X', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDC_XREQX_FID') CREATE INDEX IDX_MDC_XREQX_FID ON T_IM_MDC_XMFTREQENTRY_X ( FID );





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