Handling filter errors
The module writes error messages to the trace file described in the previous section. The message includes the row ID of the row that caused the error. You can use the row ID to select the offending row from the table, fix the problem with the document, and update or reinsert the row in the table with the fixed document.
If you specify STOP_ON_ERROR
for the FILTER index
parameter, you cannot finish executing the statement until all filter
problems have been resolved. This means that if you execute the CREATE
INDEX statement to create an index on a table that currently contains
rows, the index is created only when there are no filter problems
with any existing documents. Similarly, if you execute the INSERT
statement to insert new rows into a table that already has an etx index,
the INSERT statement completes only when all the new documents have
no filter problems.
If you specify CONTINUE_ON_ERROR
, filtering errors
do not stop the execution of the CREATE INDEX, INSERT, or UPDATE statement.
If an error is encountered while filtering a document, the unfiltered
document, along with any formatting information, is added to the index
instead. When the statement is finished, a list of all the rows whose
documents could not be filtered is written to the trace file. You
can use the list of row IDs first to fix the problems with the documents
and then to update the rows. As the rows in the table are updated,
the corresponding entry in the index is also updated. If the original
filtering problem was fixed, the new index entry contains the filtered
document.
The following example shows one of many ways to correct a filtering problem after an index has been created.
Suppose you create an etx index on the abstract column
of the table called reports. You also specify FILTER=CONTINUE_ON_ERROR
so
that the documents in the column are filtered. The abstract column
is of data type BLOB and the table contains 100 rows.
Although the CREATE INDEX statement successfully finishes executing, the trace log indicates that row 65 had a filtering problem. This means that the document in the abstract column of row 65 was not filtered before it was added to the index; it was added with all its formatting information.
SELECT LoToFile (abstract, '/tmp/outfile', 'client')
FROM my_table
WHERE rowid = 65;
UPDATE my_table
SET abstract = FileToCLOB ('/tmp/infile' , 'client')
WHERE rowid = 65;
When you update the abstract column in the table, you are also updating the etx index built on this column. The index on the abstract column for the preceding example reflects changes to the data in row 65.