Board index » delphi » Identify a FK in a table

Identify a FK in a table

Hi,

  I would like to know if there is a quick way to identify whether a data
field is a foreign key of something (and what table does it relate to) in
BCB4.  I would also like to know how I can do the reverse.  Namely,
identifying the data fields in other tables that references a table in
question.

Thanks,

Frank

 

Re:Identify a FK in a table


Take a look at the chapter 'System Tables and Views' in the InterBase
Language Reference.

Tables RDB$RELATION_CONSTRAINTS lists all constraints, table
RDB$REF_CONSTRAINTS returns info about FK constraints.

--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."

Quote
"Synergy" <fw...@interchange.ubc.ca> wrote in message

news:3bcdb3cf$1_2@dnews...
Quote
> Hi,

>   I would like to know if there is a quick way to identify whether a data
> field is a foreign key of something (and what table does it relate to) in
> BCB4.  I would also like to know how I can do the reverse.  Namely,
> identifying the data fields in other tables that references a table in
> question.

> Thanks,

> Frank

Re:Identify a FK in a table


I am now looking in the system tables for the constraints, and I am making
progress.

Thanks.

Quote
"Martijn Tonies" <m.ton...@upscene--remove.com> wrote in message

news:3bcdbe16_1@dnews...
Quote
> Take a look at the chapter 'System Tables and Views' in the InterBase
> Language Reference.

> Tables RDB$RELATION_CONSTRAINTS lists all constraints, table
> RDB$REF_CONSTRAINTS returns info about FK constraints.

> --
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com

> Upscene Productions
> http://www.upscene.com

> "This is an object-oriented system.
> If we change anything, the users object."

Other Threads