Subject Re: [firebird-support] Finding primary key field RDB$ tables
Author Helen Borrie
At 12:10 AM 29/03/2005 +0200, you wrote:

>Hi
>
>How do I from the RDB$ tables find out which field in a table that is
>primary key?

select ris.rdb$field_name
from rdb$relation_constraints rc
join rdb$index_segments ris
on ris.rdb$index_name = rc.rdb$index_name
where rc.rdb$relation_name = 'ATABLE'
and rc.rdb$constraint_type = 'PRIMARY KEY'

./hb