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

 EXEC P_ALTERPK 'PK_ER_CORPACCOUNTSETTING', 'T_ER_CORPACCOUNTSETTING', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_ER_CORPACCOUNTSETTING_L', 'T_ER_CORPACCOUNTSETTING_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_ER_CORPACCOUNTSETENTRY', 'T_ER_CORPACCOUNTSETENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_ER_CORPACCENTRY_ORG') CREATE INDEX INDEX_ER_CORPACCENTRY_ORG ON T_ER_CORPACCOUNTSETENTRY ( FACCOUNTRELORG );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_ER_CORPACCENTRY_SUBACC') CREATE INDEX INDEX_ER_CORPACCENTRY_SUBACC ON T_ER_CORPACCOUNTSETENTRY ( FSUBACCOUNTNAME );



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