Subject Re: How to find out the primary key field of a table
Author Adam
--- In firebird-support@yahoogroups.com, "alanpltse" <alanpltse@...>
wrote:
>
> Hi,
>
> I got empty record set by executing the code in the link:
>
> SELECT RC.RDB$CONSTRAINT_NAME AS CONSTRAINT_NAME,
> I.RDB$RELATION_NAME AS TABLE_NAME,
> S.RDB$FIELD_NAME AS COLUMN_NAME
> FROM RDB$RELATION_CONSTRAINTS RC
> LEFT JOIN RDB$INDICES I ON
> (I.RDB$INDEX_NAME = RC.RDB$INDEX_NAME)
> LEFT JOIN RDB$INDEX_SEGMENTS S ON
> (S.RDB$INDEX_NAME = I.RDB$INDEX_NAME)
> WHERE (RC.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY')
> AND (I.RDB$RELATION_NAME = 'USERS')
>
> What is the 'USERS'?
> In addition, how do I find out primary key field of a particular
table ?

You obviously didn't trouble yourself to read the instructions in the
post that you grabbed the code from. There is only one sentence and
it answers both your questions.

Adam