Re: primary and foregin keys
From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Sun, 26 Dec 2004 22:29:32 GMT
Message-ID: <gXGzd.10358$9j5.5360_at_newsread3.news.pas.earthlink.net>
>> Going back to the original question, though, the 'foreign key' is
>> always satisfied - any given row contains a prod_number that
>> appears in the (same row of the) same table. So, it is a
>> pointless constraint. (And, if the FK condition meant that the
>> current row was not a candidate for matching, then you'd always
>> have to insert at least two rows with the given prod_number when
>> you first inserted a prod_number, and the checking would have to
>> be appropriately deferred.)
Date: Sun, 26 Dec 2004 22:29:32 GMT
Message-ID: <gXGzd.10358$9j5.5360_at_newsread3.news.pas.earthlink.net>
rallykarro_at_hotmail.com wrote:
> Jonathan Leffler wrote:
>> Going back to the original question, though, the 'foreign key' is
>> always satisfied - any given row contains a prod_number that
>> appears in the (same row of the) same table. So, it is a
>> pointless constraint. (And, if the FK condition meant that the
>> current row was not a candidate for matching, then you'd always
>> have to insert at least two rows with the given prod_number when
>> you first inserted a prod_number, and the checking would have to
>> be appropriately deferred.)
> > Hmmm... > Why is the foreign key always satisfied?
It isn't -- I misread the example. Apologies for the irrelevant answer.
-- Jonathan Leffler #include <disclaimer.h> Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/Received on Sun Dec 26 2004 - 23:29:32 CET