/**Begin D:\PDM_UPGRADE\PDM1\PUR_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_PUR_PRODUCT', 'T_PUR_PRODUCT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_REGCORESTAFF', 'T_PUR_REGCORESTAFF', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_REGSUCUSTOMER', 'T_PUR_REGSUCUSTOMER', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_REGSTOCK', 'T_PUR_REGSTOCK', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_REGSUPPLIER_C', 'T_PUR_REGSUPPLIER_C', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_PUR_REGSUPPLIER_C') CREATE INDEX IDX_T_PUR_REGSUPPLIER_C ON T_PUR_REGSUPPLIER_C ( FISSUERFIID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDXCER_T_PUR_REGSUPPLIER_C') CREATE INDEX IDXCER_T_PUR_REGSUPPLIER_C ON T_PUR_REGSUPPLIER_C ( FCERTIFIAPPLYID );


 EXEC P_ALTERPK 'PK_PUR_CACATEGORY', 'T_PUR_CACATEGORY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CACATEGORY') CREATE INDEX IDX_PUR_CACATEGORY ON T_PUR_CACATEGORY ( FID ,FCATEGORYID );


 EXEC P_ALTERPK 'PK_PUR_CAMEMBER', 'T_PUR_CAMEMBER', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CAMEMBER') CREATE INDEX IDX_PUR_CAMEMBER ON T_PUR_CAMEMBER ( FID ,FMEMBERID );


 EXEC P_ALTERPK 'PK_PUR_CERTIFIAPPLY', 'T_PUR_CERTIFIAPPLY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CERTIFIAPPLY') CREATE INDEX IDX_PUR_CERTIFIAPPLY ON T_PUR_CERTIFIAPPLY ( FBILLNO ,FORGID );


 EXEC P_ALTERPK 'PK_PUR_ISSUERFI', 'T_PUR_ISSUERFI', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_ISSUERFI') CREATE INDEX IDX_PUR_ISSUERFI ON T_PUR_ISSUERFI ( FSUPPLIERNAME ,FBILLNO ,FCERTIFIAPPLYID );


 EXEC P_ALTERPK 'PK_PUR_RFICONENTRY', 'T_PUR_RFICONENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_RFICONENTRY') CREATE INDEX IDX_PUR_RFICONENTRY ON T_PUR_RFICONENTRY ( FID ,FRFICONTENTID );


 EXEC P_ALTERPK 'PK_PUR_RFIENTRYINFO', 'T_PUR_RFIENTRYINFO', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_RFICONTENT', 'T_PUR_RFICONTENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_RFICONTENT') CREATE INDEX IDX_PUR_RFICONTENT ON T_PUR_RFICONTENT ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_PUR_RFICONTENT_L', 'T_PUR_RFICONTENT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_APTITUDESTDCONFIG', 'T_PUR_APTITUDESTDCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_APTITUDESTDCONFIG') CREATE INDEX IDX_PUR_APTITUDESTDCONFIG ON T_PUR_APTITUDESTDCONFIG ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_PUR_APTITUDESTDCONFIG_L', 'T_PUR_APTITUDESTDCONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_EVAFACTOR', 'T_PUR_EVAFACTOR', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_EVAFACTOR') CREATE INDEX IDX_PUR_EVAFACTOR ON T_PUR_EVAFACTOR ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_PUR_EVAFACTOR_L', 'T_PUR_EVAFACTOR_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_CONTENTCONFIG', 'T_PUR_CONTENTCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CONTENTCONFIG') CREATE INDEX IDX_PUR_CONTENTCONFIG ON T_PUR_CONTENTCONFIG ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_PUR_CONTENTCONFIG_L', 'T_PUR_CONTENTCONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_TARGETANDCATEGORY', 'T_PUR_TARGETANDCATEGORY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_TARGETANDCATEGORY') CREATE INDEX IDX_PUR_TARGETANDCATEGORY ON T_PUR_TARGETANDCATEGORY ( FID ,FCATEGORYID );


 EXEC P_ALTERPK 'PK_PUR_ASSESSENTRY', 'T_PUR_ASSESSENTRY', 'FENTRYID', '1';

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

 EXEC P_ALTERPK 'PK_T_PUR_MGATT', 'T_PUR_MGATT', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_PUR_MGATT') CREATE INDEX IDX_T_PUR_MGATT ON T_PUR_MGATT ( FBASEDATAID );
 
  EXEC P_ALTERPK 'PK_T_PUR_INSPECT', 'T_PUR_INSPECT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_AUDITENTRY', 'T_PUR_AUDITENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_AUDITENTRYATT', 'T_PUR_AUDITENTRYATT', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PUR_INSPECTFIND', 'T_PUR_INSPECTFIND', 'FENTRYID', '1';

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

  EXEC P_ALTERPK 'PK_T_PUR_EXAMATTACHMENT', 'T_PUR_EXAMATTACHMENT', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_PUR_EXAMATTACHMENT') CREATE INDEX IDX_T_PUR_EXAMATTACHMENT ON T_PUR_EXAMATTACHMENT ( FBASEDATAID );
 
/**End D:\PDM_UPGRADE\PDM1\PUR_constraint.sql **/
