 EXEC P_ALTERPK 'PK_T_KF_CUSPARAMTYPE', 'T_KF_CUSPARAMTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_KF_CUSPARAMTYPE_L', 'T_KF_CUSPARAMTYPE_L', 'FPKID', '1';

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


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_KF_PARAM' AND KSQL_INDNAME = 'IDX_KF_PARAM_ID')
 CREATE UNIQUE INDEX IDX_KF_PARAM_ID ON T_KF_PARAM ( FID ,FNUMBER );


 EXEC P_ALTERPK 'PK_T_KF_PARAM_L', 'T_KF_PARAM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_KF_PARAM_L' AND KSQL_INDNAME = 'IDX_KF_PARAM_L_FID')
 CREATE UNIQUE INDEX IDX_KF_PARAM_L_FID ON T_KF_PARAM_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_KF_CUSPARAMTYPE_REF', 'T_KF_CUSPARAMTYPE_REF', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_KF_CUSPARAMTYPE_REF' AND KSQL_INDNAME = 'IDX_KF_CPT_REF_INSNUMBER')
 CREATE INDEX IDX_KF_CPT_REF_INSNUMBER ON T_KF_CUSPARAMTYPE_REF ( FINSNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_KF_CUSPARAMTYPE_REF' AND KSQL_INDNAME = 'IDX_KF_CPT_REF_CPTNUMBER')
 CREATE INDEX IDX_KF_CPT_REF_CPTNUMBER ON T_KF_CUSPARAMTYPE_REF ( FCPTNUMBER );