Subject | RE: [firebird-support] Re: Checking periods don't overlap |
---|---|
Author | Alan McDonald |
Post date | 2004-06-14T14:29:57Z |
> The only workaround I can think of (that doesn't use locking):Do you do back/forward passes? you could alert the user there or mark
>
> quantify the timestamps as an integer or something (ie representing
> each 10-minute time period as in cast(ts * 144.000 as integer) ).
> Then store these in a table like:
>
> create table X (idcode integer not null, timecode integer not null,
> primary key(idcode,timecode));
>
> So a 1 hour period would insert 6 records into this table. A 1 day
> period 144 records.
>
> Post a record in the original table that overlaps an existing one,
> and the trigger will cause duplicate keys to be entered into table X,
> causing an exception!
>
> Problem solved. If you can cope with 10 minute resolution. And
> potentially millions of records that arn't used for anything except a
> constraint.
>
> Personally I'd probably go with using a selectable sproc to access my
> original table. And cope with any dup periods in that. Planning would
> be screwed, of course.
>
> John
>
conficting records and leave them out of further calcs?
Alan