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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMOUTBIL') CREATE INDEX IDX_IM_MDC_OMOUTBIL ON T_IM_MDC_OMOUTBILL ( FBILLNO ,FORGID );


 EXEC P_ALTERPK 'PK_T_IM_MDC_OMOUTBILL_M', 'T_IM_MDC_OMOUTBILL_M', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_IM_MDC_OMOUTBILLENTRY', 'T_IM_MDC_OMOUTBILLENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMOUTBILLENTRY') CREATE INDEX IDX_IM_MDC_OMOUTBILLENTRY ON T_IM_MDC_OMOUTBILLENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_IM_MDC_OMOUTBILLENTRY_M', 'T_IM_MDC_OMOUTBILLENTRY_M', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IM_MDC_OMOUTBILLENTRY_R', 'T_IM_MDC_OMOUTBILLENTRY_R', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IM_MDC_OMOUTBILL_L', 'T_IM_MDC_OMOUTBILL_L', 'FPKID', '1';

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



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