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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Trigger to Prevent Duplicates

Re: Trigger to Prevent Duplicates

From: Alan <alanshein_at_erols.com>
Date: Mon, 18 Mar 2002 16:13:32 -0500
Message-ID: <a75l9t$isobg$1@ID-114862.news.dfncis.de>


Why don't you just create a UNIQUE constraint?

"Stuart Cowen" <stuco_at_cobaltspoon.com> wrote in message news:29563b71.0203181258.28344133_at_posting.google.com...
> I have an Oracle 7.3.4.5.0 database on Solaris with a table that is
> inserted into via an online application (no batch inserts or updates).
>
> I need to create a trigger that can check for duplicates within
> certain parameters in a sales results table. For example: Customer A
> can purchase as many of Product A as he/she wants in a given day, but
> can only purchase one unit of Product B per day.
>
> So I need a trigger that will reject a duplicate entry of Product B
> for Customer A for a given day.
>
> How would I go about doing this?
>
> Thanks in advance!
>
> Stuart Cowen
> ORACLE DBA
> stuco_at_cobaltspoon.com
Received on Mon Mar 18 2002 - 15:13:32 CST

Original text of this message

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