rstoetter libsqlphp cKEY_COLUMN_USAGE_Entry - rstoetter/libsqlphp GitHub Wiki

rstoetter\libsqlphp\cKEY_COLUMN_USAGE_Entry

  • Class name: cKEY_COLUMN_USAGE_Entry
  • Namespace: rstoetter\libsqlphp

The class cKEY_COLUMN_USAGE_Entry implements an entry of cKEY_COLUMN_USAGE, which manages objects of type cKEY_COLUMN_USAGE_Entry The namespace is rstoetter\libsqlphp.

mysql> describe KEY_COLUMN_USAGE; +-------------------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------------------+--------------+------+-----+---------+-------+ | CONSTRAINT_CATALOG | varchar(512) | NO | | | | | CONSTRAINT_SCHEMA | varchar(64) | NO | | | | | CONSTRAINT_NAME | varchar(64) | NO | | | | | TABLE_CATALOG | varchar(512) | NO | | | | | TABLE_SCHEMA | varchar(64) | NO | | | | | TABLE_NAME | varchar(64) | NO | | | | | COLUMN_NAME | varchar(64) | NO | | | | | ORDINAL_POSITION | bigint(10) | NO | | 0 | | | POSITION_IN_UNIQUE_CONSTRAINT | bigint(10) | YES | | NULL | | | REFERENCED_TABLE_SCHEMA | varchar(64) | YES | | NULL | | | REFERENCED_TABLE_NAME | varchar(64) | YES | | NULL | | | REFERENCED_COLUMN_NAME | varchar(64) | YES | | NULL | | +-------------------------------+--------------+------+-----+---------+-------+ 12 rows in set (0.24 sec)

mysql> select TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_TABLE_NAME from information_schema.KEY_COLUMN_USAGE where TABLE_NAME = 'TEST_FK';

+------------+------------------+-----------------+-----------------------+ | TABLE_NAME | COLUMN_NAME | CONSTRAINT_NAME | REFERENCED_TABLE_NAME | +------------+------------------+-----------------+-----------------------+ | TEST_FK | ID_MANDANT | PRIMARY | NULL | | TEST_FK | ID_BUCHUNGSKREIS | PRIMARY | NULL | | TEST_FK | f1 | PRIMARY | NULL | | TEST_FK | ID_MANDANT | TEST_FK_ibfk_1 | MANDANT | | TEST_FK | ID_MANDANT | TEST_FK_ibfk_2 | BUCHUNGSKREIS | | TEST_FK | ID_BUCHUNGSKREIS | TEST_FK_ibfk_2 | BUCHUNGSKREIS | | TEST_FK | fk_1 | TEST_FK_ibfk_3 | t11 | | TEST_FK | ID_MANDANT | TEST_FK_ibfk_4 | t11 | | TEST_FK | ID_BUCHUNGSKREIS | TEST_FK_ibfk_4 | t11 | | TEST_FK | fk_2 | TEST_FK_ibfk_4 | t11 | +------------+------------------+-----------------+-----------------------+ 10 rows in set (0.00 sec)

The KEY_COLUMN_USAGE table describes which key columns have constraints. Notes:

If the constraint is a foreign key, then this is the column of the foreign key, not the column that the foreign key references.

The value of ORDINAL_POSITION is the column's position within the constraint, not the column's position within the table. Column positions are numbered beginning with 1.

The value of POSITION_IN_UNIQUE_CONSTRAINT is NULL for unique and primary-key constraints. For foreign-key constraints, it is the ordinal position in key of the table that is being referenced.

PRI=> primary key
UNI=> unique key
If Key is MUL, the column is the first column of a nonunique index in which multiple occurrences of a given value are
permitted within the column.
If more than one of the Key values applies to a given column of a table, Key displays the one with the highest priority,
in the order PRI, UNI, MUL.

properties of class cKEY_COLUMN_USAGE_Entry


methods of class cKEY_COLUMN_USAGE_Entry