/**Begin D:\PDM_UPGRADE\PDM1\PDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_IM_MDC_OMINBILLENTRY_R', 'T_IM_MDC_OMINBILLENTRY_R', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDC_OMINBILLENTRY_L', 'T_IM_MDC_OMINBILLENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMINBEL_FENTRYID') CREATE INDEX IDX_IM_MDC_OMINBEL_FENTRYID ON T_IM_MDC_OMINBILLENTRY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_IM_MDC_OMINBILLENTRY_F', 'T_IM_MDC_OMINBILLENTRY_F', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDC_OMINBILLENTRY', 'T_IM_MDC_OMINBILLENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMINBE_FSEQ') CREATE INDEX IDX_IM_MDC_OMINBE_FSEQ ON T_IM_MDC_OMINBILLENTRY ( FSEQ );


 EXEC P_ALTERPK 'PK_IM_MDC_OMINBILL_L', 'T_IM_MDC_OMINBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_IM_MDC_OMINBILL', 'T_IM_MDC_OMINBILL', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMINB_FCREATETIME') CREATE INDEX IDX_IM_MDC_OMINB_FCREATETIME ON T_IM_MDC_OMINBILL ( FCREATETIME );



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