Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: How do I avoid overlapping values?
I dont think you have a choice on the triggers. I don't think there is a=
nother way to do what you want without using triggers.
john
Bjørn Augestad wrote:
> Greetings,
>
> Does anyone know a good way to solve the following problem, using Oracl=
e 8.1.5?
>
> I have a table called foo, with 3 columns, dateFrom, dateTo and price, =
looks something like this:
> create table foo (
> dateFrom date,
> dateTo date,
> price number
> );
>
> The table contains multiple rows, and what I need to avoid is that 2 ro=
ws overlap.
> dateFrom dateTo price
> Row 1: '01/01/1990' '12/12/1990' 100.00
> Row 2: '02/02/1990' '02/02/1991' 120.00
>
> The rows above tries to illustrate the problem, that both rows contains=
a (different) price for the same date range(02/02 to 12/12).
>
> I know that I can use triggers to test for overlap, but that solution d=
oesn't scale, and the table may contain 1M rows or more.
>
> TIA
> Bjørn Augestad
Received on Thu Jun 03 1999 - 19:01:36 CDT
![]() |
![]() |