I initially thought it was not possible to infer the column name of some of the constraints, but it turns out the NOT NULL
constraints are actually implemented as CHECK
constraints.
I have expanded the query by Ed Mendez in his answer to also include check constraints which should give you all constraints and the tables and columns they use (with the exception of the target table+columns of a foreign key as I was too lazy to include RDB$REF_CONSTRAINTS
):
SELECT RDB$CONSTRAINT_NAME, RDB$CONSTRAINT_TYPE,
RDB$RELATION_NAME, RDB$FIELD_NAME
FROM (
SELECT REL_CONS.RDB$CONSTRAINT_NAME, REL_CONS.RDB$CONSTRAINT_TYPE,
REL_CONS.RDB$RELATION_NAME, ISEG.RDB$FIELD_NAME
FROM RDB$RELATION_CONSTRAINTS REL_CONS
INNER JOIN RDB$INDEX_SEGMENTS ISEG
ON ISEG.RDB$INDEX_NAME = REL_CONS.RDB$INDEX_NAME
UNION ALL
SELECT REL_CONS.RDB$CONSTRAINT_NAME, REL_CONS.RDB$CONSTRAINT_TYPE,
REL_CONS.RDB$RELATION_NAME, CH_CONS.RDB$TRIGGER_NAME
FROM RDB$RELATION_CONSTRAINTS REL_CONS
INNER JOIN RDB$CHECK_CONSTRAINTS CH_CONS
ON CH_CONS.RDB$CONSTRAINT_NAME = REL_CONS.RDB$CONSTRAINT_NAME
) a
WHERE a.RDB$CONSTRAINT_NAME = 'INTEG_172'