/**Begin D:\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEFIELD', 'T_HRCS_DYNASCHEMEFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEMEFIELD_FSCHEMEID') CREATE INDEX IDX_HRCS_DYNASCHEMEFIELD_FSCHEMEID ON T_HRCS_DYNASCHEMEFIELD ( FSCHEMEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNADSPERSONENTRY', 'T_HRCS_DYNADSPERSONENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNACONDAPPLYCLS', 'T_HRCS_DYNACONDAPPLYCLS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNACONDAPPLYCLS') CREATE INDEX IDX_HRCS_DYNACONDAPPLYCLS ON T_HRCS_DYNACONDAPPLYCLS ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASEARCHADMINORG', 'T_HRCS_DYNASEARCHADMINORG', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASEARCHADMINORG') CREATE INDEX IDX_HRCS_DYNASEARCHADMINORG ON T_HRCS_DYNASEARCHADMINORG ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNARULEPARAMENUM', 'T_HRCS_DYNARULEPARAMENUM', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNADSPARAMENTRY_L', 'T_HRCS_DYNADSPARAMENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNADSPARAMENTRY_L') CREATE INDEX IDX_HRCS_DYNADSPARAMENTRY_L ON T_HRCS_DYNADSPARAMENTRY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNADSPERSONENTRY_L', 'T_HRCS_DYNADSPERSONENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNADSPERSONENTRY_L') CREATE INDEX IDX_HRCS_DYNADSPERSONENTRY_L ON T_HRCS_DYNADSPERSONENTRY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNADATASOURCE', 'T_HRCS_DYNADATASOURCE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNADATASOURCE_FENTITYTYPEID') CREATE INDEX IDX_HRCS_DYNADATASOURCE_FENTITYTYPEID ON T_HRCS_DYNADATASOURCE ( FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMECANCEL', 'T_HRCS_DYNASCHEMECANCEL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNADATASOURCE_L', 'T_HRCS_DYNADATASOURCE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNARULEPARAM_L', 'T_HRCS_DYNARULEPARAM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEDIMGRP', 'T_HRCS_DYNASCHEMEDIMGRP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEMEDIMGRP_FSCHEMEID') CREATE INDEX IDX_HRCS_DYNASCHEMEDIMGRP_FSCHEMEID ON T_HRCS_DYNASCHEMEDIMGRP ( FSCHEMEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCENE', 'T_HRCS_DYNASCENE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCENE_FNUMBER') CREATE INDEX IDX_HRCS_DYNASCENE_FNUMBER ON T_HRCS_DYNASCENE ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCENE_FMSGPUBLISHERID') CREATE INDEX IDX_HRCS_DYNASCENE_FMSGPUBLISHERID ON T_HRCS_DYNASCENE ( FMSGPUBLISHERID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCENE_L', 'T_HRCS_DYNASCENE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNASEARCHSTDPOS', 'T_HRCS_DYNASEARCHSTDPOS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASEARCHSTDPOS') CREATE INDEX IDX_HRCS_DYNASEARCHSTDPOS ON T_HRCS_DYNASEARCHSTDPOS ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNARULEOPERATOR', 'T_HRCS_DYNARULEOPERATOR', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNARULEOPERATOR_FNUMBER') CREATE INDEX IDX_HRCS_DYNARULEOPERATOR_FNUMBER ON T_HRCS_DYNARULEOPERATOR ( FNUMBER );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEME', 'T_HRCS_DYNASCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEME_FNUMBER') CREATE INDEX IDX_HRCS_DYNASCHEME_FNUMBER ON T_HRCS_DYNASCHEME ( FNUMBER );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEDIMVAL', 'T_HRCS_DYNASCHEMEDIMVAL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNACONDAPPLYBD', 'T_HRCS_DYNACONDAPPLYBD', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNACONDAPPLYBD') CREATE INDEX IDX_HRCS_DYNACONDAPPLYBD ON T_HRCS_DYNACONDAPPLYBD ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASEARCHPOS', 'T_HRCS_DYNASEARCHPOS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASEARCHPOS') CREATE INDEX IDX_HRCS_DYNASEARCHPOS ON T_HRCS_DYNASEARCHPOS ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEDRENTRY', 'T_HRCS_DYNASCHEMEDRENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEDATARULE', 'T_HRCS_DYNASCHEMEDATARULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEMEDATARULE_FSCHEMEID') CREATE INDEX IDX_HRCS_DYNASCHEMEDATARULE_FSCHEMEID ON T_HRCS_DYNASCHEMEDATARULE ( FSCHEMEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASEARCHPARAM', 'T_HRCS_DYNASEARCHPARAM', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASEARCHPARAM') CREATE INDEX IDX_HRCS_DYNASEARCHPARAM ON T_HRCS_DYNASEARCHPARAM ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEFLDENTRY', 'T_HRCS_DYNASCHEMEFLDENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNACOND', 'T_HRCS_DYNACOND', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNACOND_FNUMBER') CREATE INDEX IDX_HRCS_DYNACOND_FNUMBER ON T_HRCS_DYNACOND ( FNUMBER );


 EXEC P_ALTERPK 'PK_HRCS_DYNACOND_L', 'T_HRCS_DYNACOND_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMESCENE', 'T_HRCS_DYNASCHEMESCENE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNARULEPARAMENUM_L', 'T_HRCS_DYNARULEPARAMENUM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNARULEPARAMENUM_L') CREATE INDEX IDX_HRCS_DYNARULEPARAMENUM_L ON T_HRCS_DYNARULEPARAMENUM_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASEARCHJOB', 'T_HRCS_DYNASEARCHJOB', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASEARCHJOB') CREATE INDEX IDX_HRCS_DYNASEARCHJOB ON T_HRCS_DYNASEARCHJOB ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMERANGE', 'T_HRCS_DYNASCHEMERANGE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEMERANGE_FSCHEMEID') CREATE INDEX IDX_HRCS_DYNASCHEMERANGE_FSCHEMEID ON T_HRCS_DYNASCHEMERANGE ( FSCHEMEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNARULEOPERATOR_L', 'T_HRCS_DYNARULEOPERATOR_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNADSPERSONTYPE', 'T_HRCS_DYNADSPERSONTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNADSPERSONTYPE_FENTITYTYPEID') CREATE INDEX IDX_HRCS_DYNADSPERSONTYPE_FENTITYTYPEID ON T_HRCS_DYNADSPERSONTYPE ( FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEROLE', 'T_HRCS_DYNASCHEMEROLE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNADSPARAMENTRY', 'T_HRCS_DYNADSPARAMENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEME_L', 'T_HRCS_DYNASCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNARULEPARAM', 'T_HRCS_DYNARULEPARAM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNARULEPARAM_FNUMBER') CREATE INDEX IDX_HRCS_DYNARULEPARAM_FNUMBER ON T_HRCS_DYNARULEPARAM ( FNUMBER );


 EXEC P_ALTERPK 'PK_HRCS_DYNASEARCHLABTYPE', 'T_HRCS_DYNASEARCHLABTYPE', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASEARCHLABTYPE') CREATE INDEX IDX_HRCS_DYNASEARCHLABTYPE ON T_HRCS_DYNASEARCHLABTYPE ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEBDENTRY', 'T_HRCS_DYNASCHEMEBDENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEORG', 'T_HRCS_DYNASCHEMEORG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEMEORG_FSCHEMEID') CREATE INDEX IDX_HRCS_DYNASCHEMEORG_FSCHEMEID ON T_HRCS_DYNASCHEMEORG ( FSCHEMEID );
 
 
 EXEC P_ALTERPK 'PK_HRCS_DYNASCHEMEROLE_L', 'T_HRCS_DYNASCHEMEROLE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DYNASCHEMEROLE_L') CREATE INDEX IDX_HRCS_DYNASCHEMEROLE_L ON T_HRCS_DYNASCHEMEROLE_L ( FLOCALEID ,FENTRYID );


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