Using the Violations Table
The following rules concern the structure and use of the violations
table:
- Every pair of update rows in the violations table has the same value in the informix_tupleid column to indicate that both rows refer to the same row in the target table.
- If the target table has columns named informix_tupleid, informix_optype, or informix_recowner, the database server attempts to generate alternative names for these columns in the violations table by appending a digit to the end of the column name (for example, informix_tupleid1). If this fails, an error is returned, and no violations table is started for the target table.
- When a table functions as a violations table, it cannot have triggers or constraints defined on it.
- When a table functions as a violations table, users can create indexes on it, even though the existence of an index affects performance. Unique indexes on the violations table cannot be set to FILTERING database object mode.
- If a target table has a violations and diagnostics table associated with it, dropping the target table in cascade mode (the default mode) causes the violations and diagnostics tables to be dropped also. If the target table is dropped in the restricted mode, the DROP TABLE operation fails (because the violations and diagnostics tables exist).
- After a violations table is started for a target table, ALTER TABLE cannot add, modify, or drop columns of the violations, diagnostics, or target tables. Before you can alter any of these tables, you must issue a STOP VIOLATIONS TABLE statement for the target table.
- The database server does not clear out the contents of the violations table before or after it uses the violations table during an INSERT, UPDATE, DELETE, or SET Database Object Mode operation.
- If a target table has a filtering-mode constraint or unique index
defined on it and a violations table associated with it, users cannot
insert into the target table by selecting from the violations table.
Before you insert rows into the target table by selecting from the
violations table, you must take one of the following steps:
- You can set the constraint or unique index to DISABLED mode.
- You can issue STOP VIOLATIONS TABLE for the target table.
If it is inconvenient to take either of these steps, but you intend to copy records from the violations table into the target table, a third option is to select from the violations table into a temporary table and then insert the contents of the temporary table into the target table.
- If the target table that is specified in the START VIOLATIONS TABLE statement is fragmented, the violations table has the same fragmentation strategy as the target table. Each fragment of the violations table is stored in the same dbspace partition as the corresponding fragment of the target table.
- Once a violations table is started for a target table, you cannot use the ALTER FRAGMENT statement to alter the fragmentation strategy of the target table or the violations table.
- If the target table specified in the START VIOLATIONS TABLE statement is not fragmented, the database server places the violations table in the same dbspace as the target table.
- If the target table has BYTE or TEXT columns, BYTE or TEXT data values in the violations table are created in the same blobspace that stores the BYTE or TEXT data in the target table.