PrimaryKeys schema collection returns information about PRIMARY KEY constraints by accessing the Advanced SQL Engine Data Dictionary views. It will access DBC.INDICES[V]X and DBC.COLUMNS[V]X if UseXViews is set to true; otherwise it will access DBC.INDICES[V] and DBC.COLUMNS[V] Data Dictionary view.
Column Name | Data Type | Description |
---|---|---|
TABLE_CATALOG | String | This field is always set to EMPTY. |
TABLE_SCHEMA | String | Returns the name of the DATABASE in which TABLE object resides. |
TABLE_NAME | String | Returns the name of the TABLE object. |
COLUMN_NAME | String | Returns the name of the Column in the Primary Key. |
ORDINAL_POSITION | Int16 | Returns the position of the column in the Primary Key. For a composite Primary Key, this indicates the order of the columns making up the Primary Key. |
INDEX_NAME | String | Returns the Primary Key name. This field is NULL if the Primary Key does not have a name. |
INDEX_NUMBER | Int16 | Returns an internal number assigned to the index. |
TEMPORAL_UNIQUE_OR_PK | String |
Returns a Unique or Primary Key constraint type associated with a time dimension. This property is only applicable for a Temporal column. The valid constraint types:
|
PrimaryKeys schema collection can be filtered or restricted to:
Restriction Column Name | Restriction Number | Description |
---|---|---|
TABLE_SCHEMA | 1 | This restriction can be set to a valid DATABASE object name. |
TABLE_NAME | 2 | This restriction can be set to a valid TABLE object name. |
PrimaryKeys schema collection rows are ordered by:
Column Name | Description |
---|---|
TABLE_SCHEMA | Ascending case sensitive sort order. For example A through Z followed by a through z. |
TABLE_NAME | Ascending case sensitive sort order. |
INDEX_NUMBER | Ascending sort order. |
ORDINAL_POSITION | Ascending sort order. |