Subject Retrieve metadata from firebird
Author cwkuok
Dear,

I have two table

table1
======
tbl1_id [primary key]
tbl1_f1

table2
=======
tbl2_id [primary key]
tbl2_tbl1_id [foreign key reference to tbl1_id]
tbl2_f2

i retieve metadata using
SQL :select * from RDB$RELATION_FIELDS where RDB$FIELD_NAME NOT
LIKE 'RDB$%'

data will be shown will be sth like

RDB$FIELD_NAME | RDB$RELATION_NAME |
tbl1_id table1
tbl2_tbl1_id table2


but now i want to know part of tbl2_tbl1_id (fk) --> tbl1_id (pk). Is
there any system fields indicate these relationships ?? perhaps
having some indicators e.g. id that show tbl2_tbl1_id (fk) --->
tbl1_id (pk) ??

and what's the system fields that show field type? as while i use
RDB$FIELD_SOURCE it show either domain name or sth like RDB$13 ...
how to get the field type like varchar(20)
directly?


thanks in advance.