Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: enforce check constraint on table data
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 DBAReceived on Thu Dec 16 2004 - 15:40:48 CST
![]() |
![]() |