/**Begin D:\PDM_UPGRADE\PDM1\SOEHRR_constraint.sql **/
 EXEC P_ALTERPK 'PK_SOEHRR_COLLECTTASK', 'T_SOEHRR_COLLECTTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_COLLECTTASK' AND KSQL_INDNAME = 'IDX_SOEHRR_COLLECTTASK') CREATE INDEX IDX_SOEHRR_COLLECTTASK ON T_SOEHRR_COLLECTTASK ( FNUMBER );


 EXEC P_ALTERPK 'PK_SOEHRR_REPULSERECORD_L', 'T_SOEHRR_REPULSERECORD_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_REPULSERECORD_L' AND KSQL_INDNAME = 'IDX_SOEHRR_REPULSERECORD_L') CREATE INDEX IDX_SOEHRR_REPULSERECORD_L ON T_SOEHRR_REPULSERECORD_L ( FLOCALEID ,FID );


 EXEC P_ALTERPK 'PK_SOEHRR_COLLECTTASK_L', 'T_SOEHRR_COLLECTTASK_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_COLLECTTASK_L' AND KSQL_INDNAME = 'IDX_SOEHRR_COLLECTTASK_L') CREATE INDEX IDX_SOEHRR_COLLECTTASK_L ON T_SOEHRR_COLLECTTASK_L ( FLOCALEID ,FID );


 EXEC P_ALTERPK 'PK_SOEHRR_REPULSERECORD', 'T_SOEHRR_REPULSERECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_REPULSERECORD' AND KSQL_INDNAME = 'IDX_SOEHRR_REPULSERECORD') CREATE INDEX IDX_SOEHRR_REPULSERECORD ON T_SOEHRR_REPULSERECORD ( FTASKID );


 EXEC P_ALTERPK 'PK_SOEHRR_CTFILLUNITS', 'T_SOEHRR_CTFILLUNITS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_CTFILLUNITS' AND KSQL_INDNAME = 'IDX_SOEHRR_CTFILLUNITS') CREATE INDEX IDX_SOEHRR_CTFILLUNITS ON T_SOEHRR_CTFILLUNITS ( FENTRYID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_SOEHRR_REPORT', 'T_SOEHRR_REPORT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_REPORT' AND KSQL_INDNAME = 'IDX_SOEHRR_REPORT') CREATE INDEX IDX_SOEHRR_REPORT ON T_SOEHRR_REPORT ( FNUMBER );


 EXEC P_ALTERPK 'PK_SOEHRR_FILLTASKCHECKSTY', 'T_SOEHRR_FILLTASKCHECKSTY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_FILLTASKCHECKSTY' AND KSQL_INDNAME = 'IDX_SOEHRR_FILLTASKCHECKSTY') CREATE INDEX IDX_SOEHRR_FILLTASKCHECKSTY ON T_SOEHRR_FILLTASKCHECKSTY ( FFILLTASKID );


 EXEC P_ALTERPK 'PK_SOEHRR_FILLTASK', 'T_SOEHRR_FILLTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_FILLTASK' AND KSQL_INDNAME = 'IDX_SOEHRR_FILLTASK') CREATE INDEX IDX_SOEHRR_FILLTASK ON T_SOEHRR_FILLTASK ( FBILLNO );


 EXEC P_ALTERPK 'PK_SOEHRR_COLLECTTASKOBJS', 'T_SOEHRR_COLLECTTASKOBJS', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_COLLECTTASKOBJS' AND KSQL_INDNAME = 'IDX_SOEHRR_COLLECTTASKOBJS') CREATE INDEX IDX_SOEHRR_COLLECTTASKOBJS ON T_SOEHRR_COLLECTTASKOBJS ( FID );


 EXEC P_ALTERPK 'PK_SOEHRR_REPORT_L', 'T_SOEHRR_REPORT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_REPORT_L' AND KSQL_INDNAME = 'IDX_SOEHRR_REPORT_L') CREATE INDEX IDX_SOEHRR_REPORT_L ON T_SOEHRR_REPORT_L ( FLOCALEID ,FID );


 EXEC P_ALTERPK 'PK_SOEHRR_EXEUNITS', 'T_SOEHRR_EXEUNITS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_EXEUNITS' AND KSQL_INDNAME = 'IDX_SOEHRR_EXEUNITS') CREATE INDEX IDX_SOEHRR_EXEUNITS ON T_SOEHRR_EXEUNITS ( FID ,FBASEDATAID );



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