On this page
FIND FK
Finds foreign keys whose name, tables or columns contain the input text.
Syntax
FIND FK <text>
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
<text> | Yes | Part of a constraint, table or column name, in any case | None |
Examples
FIND FK CUSTOMER;
FIND REFERENCE CUSTOMER_ID;
Details
Matching
Every foreign key of the current schema whose constraint name, referencing table, referencing column, referenced table or referenced column contains the text is listed. Matching ignores case; % matches any text and _ any single character.
Output
One row per column pair, with the key position (#). Every column of a matching composite foreign key is listed, even when only one of them matched.
Performance and errors
The command reads the same metadata as SHOW FK and SHOW REFERENCES, table by table, so a large schema takes a moment. It fails when no text is given or when the JDBC driver cannot provide foreign key metadata.
Related
- SHOW FK, the foreign keys of one table
- SHOW REFERENCES
- FIND INDEX
- FIND COLUMN
Used in these how-tos
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.