/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_constraint.sql **/
 EXEC P_ALTERPK 'PK_AR_PLANSPLITMAPENTRY', 'T_AR_PLANSPLITMAPENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_AR_PLANSPLITMAPPING', 'T_AR_PLANSPLITMAPPING', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_AR_PLANSPLITSCHEME', 'T_AR_PLANSPLITSCHEME', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_AR_PLANSPLITSCHEME_L', 'T_AR_PLANSPLITSCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_AR_PSSCHEME_CENTRY', 'T_AR_PSSCHEME_CENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_AR_PSSCHEME_DENTRY', 'T_AR_PSSCHEME_DENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_AR_PSSCHEME_OENTRY', 'T_AR_PSSCHEME_OENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_PSS_OE_ORG') CREATE INDEX IDX_AR_PSS_OE_ORG ON T_AR_PSSCHEME_OENTRY ( FORG );



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