Subject Re: [ib-support] Checking Referential Integrity in code
Author Claudio Valderrama C.
""Frank Wang"" <wang@...> wrote in message
news:007f01c18754$7c730580$6c03aacb@toshiba...
> Hi All,
>
> I have a table customer which is being referenced by many other
> tables, I'd like to know if there is
> a generic way to check in Delphi code or SP if a certain record in the
> customer table has been referenced
> by any of those tables? example, a sql can be built based on the
> relationship defined in the .gdb and used
> to query into affected tables to see if referencing record exists, thanks
> for any help.

It's possible to detect the connection between two tables, using the same
techniques than tools like isql use to extract metadata, but you will run
into problems in real environments:

http://www.cvalde.com/document/declaRefIntegVsTrig.htm

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing