On Tue, 12 Oct 2004 15:36:57 -0400, Mark J Fenbers wrote:
> Given a table existing in my database called "AAA", I can determine if a
> foreign key exists for "AAA" by looking up the "tabid" in the systables and
> finding any "R" constraints on the table by searching in sysconstraints for
> that tabid. Then, I can look up the constraint ID in the sysreferences
> table to find the ID of the table that is the "target" of the constraint
> (table "BBB").
>
> (I can even determine what column(s) in "AAA" are bound to a constraint by
> looking up the constraint ID in the sysindexes table.)
>
> But what I cannot seem to figure out is what column(s) in "BBB" are compared
> when Informix tests the constraint. Would this be the Primary Key for
> "BBB", or not necessarily so? If my software were to output a message upon
> encountering error -691, I would want to create a message that would be
> explicit about what table has to be updated and which columns in both "AAA"
> and "BBB" must match, so that the user knows how to eliminate this error...
Yes, the primary key or a unique key constraint on BBB.
Art S. Kagel
> Any ideas?
>
> Mark