Subject Re: [firebird-support] Re: Checking periods don't overlap
Author Martijn Tonies
Hi John,

> Didn't know you could do that! But it doesn't help. I tested it with
> a simple integer field, that I wanted to be unique (without using a
> unique index!).
>
> ALTER TABLE T ADD CONSTRAINT CHK_T check (not exists (select * from
> T where intfield = new.intfield));
>
> But it only looks in the current transaction, doesn't dirty-read
> like an index does.
>
> So it's no better than using a trigger :(

What's the bother with ditry reads?

Really, I've been reading your posts but I don't get it - why do
you want to do that?

The thing about constraints is that they ensure that the committed
data is correct.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com