/**Begin D:\PDM_UPGRADE\PDM1\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPADJRECORD', 'T_EB_CENTRALAPPADJRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CENTRALAPPADJREC_FNO') CREATE INDEX IDX_EB_CENTRALAPPADJREC_FNO ON T_EB_CENTRALAPPADJRECORD ( FAPPROVEBILLNO );


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPADJENTITY', 'T_EB_CENTRALAPPADJENTITY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CENTRALAPPADJENT_FENID') CREATE INDEX IDX_EB_CENTRALAPPADJENT_FENID ON T_EB_CENTRALAPPADJENTITY ( FID ,FENTRYID );


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPPLAN', 'T_EB_CENTRALAPPPLAN', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPPLAN_TYPE', 'T_EB_CENTRALAPPPLAN_TYPE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPPLANREPORT', 'T_EB_CENTRALAPPPLANREPORT', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPPLAN_RELAT', 'T_EB_CENTRALAPPPLAN_RELAT', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPPLANBILL', 'T_EB_CENTRALAPPPLANBILL', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPPLANENTITY', 'T_EB_CENTRALAPPPLANENTITY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPRECORD', 'T_EB_CENTRALAPPRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CENTRALAPPREC_FBILL') CREATE INDEX IDX_EB_CENTRALAPPREC_FBILL ON T_EB_CENTRALAPPRECORD ( FAPPROVEBILLNO );


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPRECENTITY', 'T_EB_CENTRALAPPRECENTITY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPREL', 'T_EB_CENTRALAPPREL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPREL_USER', 'T_EB_CENTRALAPPREL_USER', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CENTRALAPPTYPE', 'T_EB_CENTRALAPPTYPE', 'FID', '1';

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



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