/**Begin C:\PDM_UPGRADE\PDM1\SRM_constraint.sql **/
 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLAN', 'T_SRM_GROUPEVAPLAN', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GEVAPLAN_FBILLDATE') CREATE INDEX IDX_SRM_GEVAPLAN_FBILLDATE ON T_SRM_GROUPEVAPLAN ( FBILLDATE );


 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLAN_L', 'T_SRM_GROUPEVAPLAN_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLANENTRY', 'T_SRM_GROUPEVAPLANENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GEVAPLANSUP_FSUPID') CREATE INDEX IDX_SRM_GEVAPLANSUP_FSUPID ON T_SRM_GROUPEVAPLANENTRY ( FSUPPLIERID );


 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLANSCORER', 'T_SRM_GROUPEVAPLANSCORER', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLANINDEX', 'T_SRM_GROUPEVAPLANINDEX', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GEVAPLANINDEX_INDEX') CREATE INDEX IDX_SRM_GEVAPLANINDEX_INDEX ON T_SRM_GROUPEVAPLANINDEX ( FINDEXID );


 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLANDETAIL', 'T_SRM_GROUPEVAPLANDETAIL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GEVADETAIL_IDSEQ') CREATE INDEX IDX_SRM_GEVADETAIL_IDSEQ ON T_SRM_GROUPEVAPLANDETAIL ( FENTRYID ,FSEQ );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GEVADETAIL_SCORER') CREATE INDEX IDX_SRM_GEVADETAIL_SCORER ON T_SRM_GROUPEVAPLANDETAIL ( FSCORERID );


 EXEC P_ALTERPK 'PK_SRM_GROUPEVAPLAN_A', 'T_SRM_GROUPEVAPLAN_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GROUPEVAPLAN_A_FTIME') CREATE INDEX IDX_SRM_GROUPEVAPLAN_A_FTIME ON T_SRM_GROUPEVAPLAN_A ( FCREATETIME );


 EXEC P_ALTERPK 'PK_SRM_GROUPEVASUBENTRY', 'T_SRM_GROUPEVASUBENTRY', 'FDETAILID', '1';

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


 EXEC P_ALTERPK 'PK_SRM_GROUPSCORERPT', 'T_SRM_GROUPSCORERPT', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_SCORE_FBILLDATE') CREATE INDEX IDX_SRM_SCORE_FBILLDATE ON T_SRM_GROUPSCORERPT ( FBILLDATE );


 EXEC P_ALTERPK 'PK_SRM_GROUPSCORERPT_L', 'T_SRM_GROUPSCORERPT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SRM_GROUPSCORERPT_A', 'T_SRM_GROUPSCORERPT_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GSCORE_A_FCREATETIME') CREATE INDEX IDX_SRM_GSCORE_A_FCREATETIME ON T_SRM_GROUPSCORERPT_A ( FCREATETIME );


 EXEC P_ALTERPK 'PK_SRM_SUPOVERALLEVAENTRY', 'T_SRM_SUPOVERALLEVAENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_SRM_SUPOVERALLEVAATT', 'T_SRM_SUPOVERALLEVAATT', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_SRM_GROUPSCORERPTENTRY', 'T_SRM_GROUPSCORERPTENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_GROUPEVARPT_FRPTID') CREATE INDEX IDX_SRM_GROUPEVARPT_FRPTID ON T_SRM_GROUPSCORERPTENTRY ( FSCORERPTNOID );

 EXEC P_ALTERPK 'PK_SRM_EVAORGENTRY', 'T_SRM_EVAORGENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_EVAORGENTRY_FEVAORGID') CREATE INDEX IDX_SRM_EVAORGENTRY_FEVAORGID ON T_SRM_EVAORGENTRY ( FEVAORGID );

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