Subject | Re: [firebird-support] Checking periods don't overlap |
---|---|
Author | Jerome Bouvattier |
Post date | 2004-06-14T08:39:52Z |
Hi,
--
Jerome
[Non-text portions of this message have been removed]
> Any idea how to check periods don't overlap?? Ie in a table:No, No. You're not. <g>
>
> create table T (entryid integer not null primary key, startdate
> timestamp not null, enddate timestamp not null);
>
> I could have a trigger like this:
>
> /* Before insert / update trigger */
> if (exists(select entryid from T where not(T.startdate > new.enddate
> or T.enddate < new.startdate) and T.entryid <> new.entryid)) then
> begin
> exception dates_overlap 'Your dates overlap';
> end
>
>
> But hey-ho, I can't dirty-read so it doesn't work properly!!!
>
> Come on guys, am I the only one who finds this a bit of a problem??
--
Jerome
[Non-text portions of this message have been removed]