Primary keys with SQ_IXLIST¶
For a source table without a primary key or unique index, list the columns that identify a row in the table
SQ_IXLIST in the agent's control schema on the source: the Capture Agent then reports them as the table's primary
key. Unlike a primary key you add to the destination table after the baseline, it's part of the table's description,
so it's there again whenever the destination table is created for a new baseline.
Where the table is¶
SQ_IXLIST is in the agent's control schema (library) on the Db2 for i source system, for example SQDR.SQ_IXLIST,
not in the staging database. A Db2 for i agent creates it when it starts, if it's missing.
Note
SQ_IXLIST is created and used automatically only for Db2 for i sources. SQL Server agents can also use key
overrides; ask Stelo Support how to set them up.
Table layout¶
| Column | What it holds |
|---|---|
TABLE_SCHEM |
The schema (library) of the table. |
TABLE_NAME |
The name of the table. |
COLUMN_NAME |
A column of the key. |
KEY_SEQ |
The column's position in the key. |
The table's primary key is (TABLE_SCHEM, TABLE_NAME, COLUMN_NAME): add one row for each key column.
Example¶
This row makes the column ID the key of the table QAUSER.APPS:
INSERT INTO SQDR.SQ_IXLIST ("TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "KEY_SEQ")
VALUES ('QAUSER', 'APPS', 'ID', 10);
Run it as a user with enough authority to the table, such as the agent user (SQDR).