Hallo,
Hab grad mal etwas gebastelt:
SQL-Code:
SELECT
rdb$relation_constraints.rdb$relation_name as tabelle,
rdb$index_segments.rdb$field_name as feld,
rdb$relation_constraints.rdb$constraint_name as fk
FROM rdb$ref_constraints
JOIN rdb$relation_constraints on (rdb$relation_constraints.rdb$constraint_name = rdb$ref_constraints.rdb$constraint_name)
JOIN rdb$index_segments on (rdb$index_segments.rdb$index_name = rdb$relation_constraints.rdb$index_name)
WHERE (rdb$relation_constraints.rdb$constraint_type = "FOREIGN KEY")
AND (rdb$ref_constraints.rdb$const_name_uq = "PK_IRGENDWAS")
Anstelle von "PK_IRGENDWAS" musst du den Namen des Primärschlüssels angeben (also Name des Constraints, nicht Name des Feldes!)
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."