detect foreign keys and referenced tables

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jasmad
Posts: 9
Joined: Wed 04 Jan 2012 21:33

detect foreign keys and referenced tables

Post by jasmad » Thu 19 Jul 2012 14:39

hi

anyone know if you can detect if a field is foreign key accessing procedures, functions or properties of TField,
and if not possible by these means it is possible to do this otherwise?

sorry about my english
fault of the google's translator

greetings

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: detect foreign keys and referenced tables

Post by ZEuS » Wed 25 Jul 2012 10:21

You can use the RDB$INDICES system table to find out, whether there is a foreign key in the specified table. Then, you can use the RDB$INDEX_SEGMENTS system table to determine, what particular fields belong to the foreign key.

jasmad
Posts: 9
Joined: Wed 04 Jan 2012 21:33

Re: detect foreign keys and referenced tables

Post by jasmad » Fri 27 Jul 2012 22:10

hi ZEuS

metadata component does not have access to this information?
instead of directly querying the database

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: detect foreign keys and referenced tables

Post by ZEuS » Tue 31 Jul 2012 08:35

The TIBCMetadata component does not provide such functionality. Please use the system tables to obtain this information.

Post Reply