Using the WITH ERKEY Keywords
Use the WITH ERKEY keywords to create the ERKEY shadow columns that Enterprise Replication uses for a replication key.
The ERKEY shadow columns (ifx_erkey_1, ifx_erkey_2, and ifx_erkey_3) are visible shadow columns because they are indexed and can be viewed in system catalog tables. After you create the ERKEY shadow columns, a new unique index and a unique constraint are created on the table using these columns. Enterprise Replication uses that index as the replication key.
- They are not returned by queries that specify an asterisk ( *
) as the projection list, as in the statement:
SELECT * FROM tablename;
- They do appear in DB-Access when you ask for information about the columns of the table.
- They are included in the number of columns (ncols) in the systables system catalog table entry for tablename.
SELECT ifx_erkey_1, ifx_erkey_2, ifx_erkey_3 FROM customer;
Example
In the following example, the ERKEY shadow columns are added to the customer table:
CREATE TABLE customer (id INT) WITH ERKEY;