Subject cached updates problem
Author l_gilbert_fr
Hi all,

I've some problems with cached updates.

I use a TIBOQUERY with cached updates enabled.
The table is a simple table with a two integers composed primary key.
One of is integers references an another table and the second is a row number.
The data are filtered on the table reference and sorted on the row number.

This table is used in my database-to-excel module to store the fields list of a user query. The reference is the query id and the row is the field number. The table stores caption, format, ... for each field.
When I refresh the fields list, I try to keep the user changes.

To do that :

- First the row number is set to negative (= not used),
- 2nd : records are updated or added. When a record is updated, its row number is set to a positive value that depend on its position.
- 3rd : records with negative row number are deleted.

A grid shows the result.

The problems with this process are :

1) when a new row is added (ie. new field), the data is not displayed sorted anymore.

2) a pk violation exception appears on apply when an existing record/field has its position (row number) changed.

In the IBO/firebird monitoring window I see :
[INTERPRET BUFFER = violation of PRIMARY or UNIQUE KEY constraint "CEXCHAMPS_PK" on table "T_EXCHAMPS"]

If someone can help me...

Thank you
Laurent.