Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: enforce check constraint on table data

Re: enforce check constraint on table data

From: Sybrand Bakker <gooiditweg_at_sybrandb.verwijderdit.demon.nl>
Date: Thu, 16 Dec 2004 22:40:48 +0100
Message-ID: <gvv3s0tjko15qq9n0u00cr4lh5j65i64h6@4ax.com>


On Thu, 16 Dec 2004 10:13:02 GMT, "deepa balu via OracleMonster.com" <forum_at_OracleMonster.com> wrote:

>
>
>hi ,
>
>How to do a check like this ??
>
>on insertion(say two columns) Need to Check whether the summation of the columns is also unique

step 1
add an extra column to the table containing the sum step 2
create a before insert for each row trigger calculating the sum write a select in this trigger to check whether the sum already exists in the table.
An unique index is not going to work, as you seem strangely enough, to require the check on insert only, not on update step 3
verify this will be dead slow.

step 4 Make sure there is a real business need for this requirement.

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Dec 16 2004 - 15:40:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US