ERR Tracing
It may be useful to trace the ERR component. For example, an ERR trace at level 4 shows all of the error messages that are pushed in the TimesTen direct driver (not all errors are output to the user because they are handled internally). ERR tracing at level 1 is the default. No output is written for ERR tracing at level 2 and 3.
Table 2-5 describes ERR tracing levels. Each level with a '+' sign includes the trace information described for that level, plus all levels preceding it.
Table 2-5 ERR tracing levels
| Level | Output |
|---|---|
|
1 (set by default) |
Fatal errors |
|
4 |
+ All other error messages, many of which are handled internally by TimesTen |
In this example, execute ttTraceMon to do a ERR trace at level 4 on myDSN database.
First, create a table:
Command> CREATE TABLE test (id TT_INTEGER);
Next, turn on tracing at level 4. Rather than direct the trace output to a file as in the previous examples, read it directly from the trace buffer. Before saving the ERR trace to the buffer, use the flush command to empty the buffer.
% ttTraceMon myDSN Trace monitor; empty line to exit Trace> level err 4 Trace> flush
Now execute a SQL script with three errors in it. The errors are:
-
Creating a table with the same name as an existing table
-
Using incorrect syntax to insert values into the table
-
Inserting
CHARdata into aTT_INTEGERcolumn
Command> CREATE TABLE test (id TT_INTEGER);
2207: Table TEST already exists
The command failed.
Command> INSERT INTO test VALUES 'abcd');
1001: Syntax error in SQL statement before or at: "'abcd'", character position:
25
insert into test values 'abcd');
^^^^^^
The command failed.
Command> INSERT INTO test VALUES ('abcd');
2609: Incompatible types found in expression
The command failed.
The trace information is written to the trace buffer. Display it by using the dump command.
Trace> dump
19:28:40.465 174227 ERR 4L 1C 24263P TT2207: Table TEST already exists
-- file "eeDDL.c", lineno 2930, procedure "sbEeCrDtblEval()"
19:28:51.399 174228 ERR 4L 1C 24263P TT1001: Syntax error in SQL
statement before or at: "'abcd'", character position: 25
insert into test values 'abcd');
^^^^^^
-- file "ptSqlY.y", lineno 6273, procedure "reserved_word_or_syntax_error"
19:29:00.725 174229 ERR 4L 1C 24263P TT2609: Incompatible types found
in expression -- file "saCanon.c", lineno 12618, procedure "sbPtAdjustType()"
3 records dumped
Set ERR tracing back to its default setting (1) and exit ttTraceMon:
Trace > level err 1
Trace > {press ENTER – blank line}