/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_IM_INVQUERYCONF', 'T_IM_INVQUERYCONF', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_INVQRY_SRCBILL') CREATE INDEX IDX_IM_INVQRY_SRCBILL ON T_IM_INVQUERYCONF ( FSRCBILLOBJ ,FOPERATEKEY );


 EXEC P_ALTERPK 'PK_T_IM_INVQUERYCONF_L', 'T_IM_INVQUERYCONF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_IM_INVQUERYMAPPING', 'T_IM_INVQUERYMAPPING', 'FENTRYID', '1';

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



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