Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trigger to Prevent Duplicates
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
![]() |
![]() |