/**Begin D:\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEADMIN', 'T_HRCS_PERMLOGROLEADMIN', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_PERMLOGROLEADMIN') CREATE INDEX IDX_HRCS_PERMLOGROLEADMIN ON T_HRCS_PERMLOGROLEADMIN ( FENTRYID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGBASEINFO', 'T_HRCS_PERMLOGBASEINFO', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGINFLUROLE', 'T_HRCS_PERMLOGINFLUROLE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEFUNC', 'T_HRCS_PERMLOGROLEFUNC', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEDIM', 'T_HRCS_PERMLOGROLEDIM', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEDR', 'T_HRCS_PERMLOGRANGEDR', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEOPEN', 'T_HRCS_PERMLOGROLEOPEN', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEBDDR', 'T_HRCS_PERMLOGRANGEBDDR', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOG', 'T_HRCS_PERMLOG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOG_L', 'T_HRCS_PERMLOG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEFIELD', 'T_HRCS_PERMLOGRANGEFIELD', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGTYPE_L', 'T_HRCS_PERMLOGTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGTYPE', 'T_HRCS_PERMLOGTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGINFLUUSER', 'T_HRCS_PERMLOGINFLUUSER', 'FENTRYID', '1';

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


  EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEBIZ', 'T_HRCS_PERMLOGRANGEBIZ', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEORG', 'T_HRCS_PERMLOGRANGEORG', 'FENTRYID', '1';

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

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