/**Begin D:\PDM_UPGRADE\PDM1\OM_constraint.sql **/


 EXEC P_ALTERPK 'PK_IM_MDCOPM_MREQOUTBILL_M', 'T_IM_MDCOPM_MREQOUTBILL_M', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDCOPM_MREQOUTBILLM_SID') CREATE INDEX IDX_IM_MDCOPM_MREQOUTBILLM_SID ON T_IM_MDCOPM_MREQOUTBILL_M ( FWORKSHOPID );


 EXEC P_ALTERPK 'PK_IM_MDCOPM_MREQOUTBILL_L', 'T_IM_MDCOPM_MREQOUTBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOPM_MREQOUTBILL', 'T_IM_MDCOPM_MREQOUTBILL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOPM_MQBENTRY_R', 'T_IM_MDCOPM_MQBENTRY_R', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOPM_MQBENTRY_M', 'T_IM_MDCOPM_MQBENTRY_M', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOPM_MQBENTRY', 'T_IM_MDCOPM_MQBENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOM_MREQOUTBILL_M', 'T_IM_MDCOM_MREQOUTBILL_M', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDCOM_MREQOUTBILL_M') CREATE INDEX IDX_IM_MDCOM_MREQOUTBILL_M ON T_IM_MDCOM_MREQOUTBILL_M ( FDOCTYPE );


 EXEC P_ALTERPK 'PK_IM_MDCOM_MREQOUTBILL_L', 'T_IM_MDCOM_MREQOUTBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOM_MREQOUTBILL', 'T_IM_MDCOM_MREQOUTBILL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOM_MQBENTRY_R', 'T_IM_MDCOM_MQBENTRY_R', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOM_MQBENTRY_M', 'T_IM_MDCOM_MQBENTRY_M', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDCOM_MQBENTRY', 'T_IM_MDCOM_MQBENTRY', 'FENTRYID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\OM_constraint.sql **/
