EXEC P_ALTERPK 'PK_T_SEC_POSITION', 'T_SEC_POSITION', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SEC_POSITION_L', 'T_SEC_POSITION_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SEC_PREPORTTYPE', 'T_SEC_PREPORTTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SEC_PREPORTTYPE_L', 'T_SEC_PREPORTTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SEC_PREPORTRELATION', 'T_SEC_PREPORTRELATION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SEC_PREPORTRELA_TYPEPOS') CREATE INDEX IDX_SEC_PREPORTRELA_TYPEPOS ON T_SEC_PREPORTRELATION ( FREPORTTYPEID ,FPOSITIONID );
