Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: How do I avoid overlapping values?
Steven Hauser wrote:
>
> Try check constraints. They can be deferred so a large insert or update can
> be checked at the end of your transaction.
> --
> ---------------------------------------------------------
> Steven Hauser
> email: hause011@tc.umn.edu URL: http://www.tc.umn.edu/~hause011
> ---------------------------------------------------------
AFAIK I can't use check constraints, since check's only validates one row. I have to verify that on existing rows in the table has a date span that contains one or more dates from the new row. Something like this
select count(*) into cOverlappingRows from foo where dateFrom <= :new_dateTo and dateTo >= :new_dateFrom; if cOverlappingRows > 0 then overlap_error ... end if;
I have a feeling that this may be too slow for our needs, but I'm stumped... Bjørn Received on Thu Jun 03 1999 - 05:57:09 CDT
![]() |
![]() |