On this page

FIND FK

Core command FIND REFERENCE FIND REFERENCES FI FK FIFK

Finds foreign keys whose name, tables or columns contain the input text.

Syntax

FIND FK <text>

Arguments

ArgumentRequiredValuesDefault
<text>YesPart of a constraint, table or column name, in any caseNone

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.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.