Re: SQL question: How to prevent mutually exclusive values?

From: Kay Kanekowski <k.kanekowski_at_phnxsoft.com>
Date: Thu, 03 Dec 1998 08:45:46 +0100
Message-ID: <366641AA.E76A0051_at_phnxsoft.com>


Hi,

I think you need a Insert-Update STATEMENT Trigger, because you have to look at all rows with the same ARREST_ID. But in a statement-trigger you don't know which is interestung row, so you must check all rows against all rows with a 'select count(count(*)) .. group by decode ( weapon_type, 'NONE', 1, 0 )' or somethig like that.

The other way is to change Data-Model. I think it's more easier to implement a column in the ARREST table to indicate the WEAPON_TYPE 'NONE' or not. Then you are able to write a ROW-Level trigger for the WEAPON table that looks at this column in the master ARREST row.

Kay Received on Thu Dec 03 1998 - 08:45:46 CET

Original text of this message