 EXEC P_ALTERPK 'PK_T_THREAD_TRACE_LOG', 'T_THREAD_TRACE_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_THREAD_TRACE_LOG_TIMESTAMP') CREATE INDEX IDX_T_THREAD_TRACE_LOG_TIMESTAMP ON T_THREAD_TRACE_LOG ( FTIMESTAMP );