/**Begin D:\PDM_UPGRADE\PDM1\kd_1.5.247_soehrr_constraint.sql **/
 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPLVAR', 'T_SOEHRR_RPTTPLVAR', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_RPTTPLVAR' AND KSQL_INDNAME = 'IDX_SOEHRR_RPTTPLVAR') CREATE INDEX IDX_SOEHRR_RPTTPLVAR ON T_SOEHRR_RPTTPLVAR ( FREPORTCONFID ,FREPENTRYID );


 EXEC P_ALTERPK 'PK_SOEHRR_RPTCLASSIFYVAR', 'T_SOEHRR_RPTCLASSIFYVAR', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_RPTCLASSIFYVAR' AND KSQL_INDNAME = 'IDX_SOEHRR_RPTCLASSIFYVAR') CREATE INDEX IDX_SOEHRR_RPTCLASSIFYVAR ON T_SOEHRR_RPTCLASSIFYVAR ( FREPORTCLASSIFYID );


 EXEC P_ALTERPK 'PK_SOEHRR_RPTCLASSIFYVAR_L', 'T_SOEHRR_RPTCLASSIFYVAR_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPL', 'T_SOEHRR_RPTTPL', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_RPTTPL' AND KSQL_INDNAME = 'IDX_SOEHRR_RPTTPL_CLA') CREATE INDEX IDX_SOEHRR_RPTTPL_CLA ON T_SOEHRR_RPTTPL ( FREPORTCLASSIFYID );


 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPL_L', 'T_SOEHRR_RPTTPL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPLENTRY', 'T_SOEHRR_RPTTPLENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPLAREA', 'T_SOEHRR_RPTTPLAREA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SOEHRR_RPTTPLAREA' AND KSQL_INDNAME = 'IDX_SOEHRR_RPTTPLAREA') CREATE INDEX IDX_SOEHRR_RPTTPLAREA ON T_SOEHRR_RPTTPLAREA ( FREPORTCONFID ,FREPENTRYID );


 EXEC P_ALTERPK 'PK_SOEHRR_RPTAREACONF', 'T_SOEHRR_RPTAREACONF', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_RPTAREACONF_L', 'T_SOEHRR_RPTAREACONF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_BELONGPERIOD', 'T_SOEHRR_BELONGPERIOD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_BELONGPERIOD_L', 'T_SOEHRR_BELONGPERIOD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPLAREA_ROW', 'T_SOEHRR_RPTTPLAREA_ROW', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_RPTTPLAREA_COL', 'T_SOEHRR_RPTTPLAREA_COL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_REPORTCLASSIFY', 'T_SOEHRR_REPORTCLASSIFY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_REPORTCLASSIFY_L', 'T_SOEHRR_REPORTCLASSIFY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_PERIODTYPE', 'T_SOEHRR_PERIODTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_SOEHRR_PERIODTYPE_L', 'T_SOEHRR_PERIODTYPE_L', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_SOEHRR_RPTTPLAREA_L', 'T_SOEHRR_RPTTPLAREA_L', 'FPKID', '1';

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


/**End D:\PDM_UPGRADE\PDM1\kd_1.5.247_soehrr_constraint.sql **/
