Subject Re: [firebird-support] What programming languages and toolkits do you use to access Firebird?
Author Fulvio Senore
Daniel Albuschat ha scritto:
>> I am not a Firebird expert, and I have written my own data access layer
>> on top of IBPP to satisfy my needs. It works well enough, but when I
>> create an editable rowset from a single table I pass the name of the
>> primary key as a parameter because I had no idea of hot to determine it
>> automatically.
>> It is not a big problem, but it would be nice to have the software
>> determine the primary key. Do know hot it can be done?
>>
>
> select
> s.rdb$field_name
> from
> rdb$relations r
> left join
> rdb$relation_constraints c
> on
> c.rdb$relation_name=r.rdb$relation_name and
> c.rdb$constraint_type='PRIMARY KEY'
> left join
> rdb$index_segments s
> on
> s.rdb$index_name=c.rdb$index_name
> where
> r.rdb$relation_name=YOUR TABLE NAME
> order by
> s.rdb$field_position
>
>
Thank you,

I will try it.

Fulvio