/**Begin C:\PDM_UPGRADE\PDM1\PUR_constraint.sql **/
 EXEC P_ALTERPK 'PK_PUR_CLAIM', 'T_PUR_CLAIM', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CLAIM_FBILLDATE_ORG') CREATE INDEX IDX_PUR_CLAIM_FBILLDATE_ORG ON T_PUR_CLAIM ( FBILLDATE ,FPURORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CLAIM_FBIZID') CREATE INDEX IDX_PUR_CLAIM_FBIZID ON T_PUR_CLAIM ( FBIZPARTNERID );


 EXEC P_ALTERPK 'PK_PUR_CLAIMENTRY', 'T_PUR_CLAIMENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CLAIMENTRY_FMATERIALID') CREATE INDEX IDX_PUR_CLAIMENTRY_FMATERIALID ON T_PUR_CLAIMENTRY ( FMATERIALID );


 EXEC P_ALTERPK 'PK_PUR_CLAIMRECORDATTA', 'T_PUR_CLAIMRECORDATTA', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CLAIMRECORD_FENTRYID') CREATE INDEX IDX_PUR_CLAIMRECORD_FENTRYID ON T_PUR_CLAIMRECORDATTA ( FENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CLAIMRECORD_FBASEID') CREATE INDEX IDX_PUR_CLAIMRECORD_FBASEID ON T_PUR_CLAIMRECORDATTA ( FBASEDATAID );


 EXEC P_ALTERPK 'PK_PUR_CLAIMRECORDENTRY', 'T_PUR_CLAIMRECORDENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_PROB_ENTRYENTITY', 'T_PUR_PROB_ENTRYENTITY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_PROBENTRY_FMATERIALID') CREATE INDEX IDX_PUR_PROBENTRY_FMATERIALID ON T_PUR_PROB_ENTRYENTITY ( FMATERIALID );


 EXEC P_ALTERPK 'PK_PUR_PROB_FEEDBACKATTA', 'T_PUR_PROB_FEEDBACKATTA', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_PROBENTRY_FBASEDATAID') CREATE INDEX IDX_PUR_PROBENTRY_FBASEDATAID ON T_PUR_PROB_FEEDBACKATTA ( FBASEDATAID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_PROBENTRY_FENTRYID') CREATE INDEX IDX_PUR_PROBENTRY_FENTRYID ON T_PUR_PROB_FEEDBACKATTA ( FENTRYID );


 EXEC P_ALTERPK 'PK_PUR_PROB_NOTICE', 'T_PUR_PROB_NOTICE', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_PROBNOTICE_FBDATE_ORG') CREATE INDEX IDX_PUR_PROBNOTICE_FBDATE_ORG ON T_PUR_PROB_NOTICE ( FBILLDATE ,FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_PROBNOTICE_FBIZID') CREATE INDEX IDX_PUR_PROBNOTICE_FBIZID ON T_PUR_PROB_NOTICE ( FBIZPARTNERID );



/**End C:\PDM_UPGRADE\PDM1\PUR_constraint.sql **/
