Subject CHECK Constraints (was: Re: [firebird-support] Re: Checking periods don't overla
Author peter_jacobi.rm
Hi Steffen,

IMHO your re-written statement is not equivalent at all.

--- "Steffen Heil" <lists@s...> wrote:
> I want to show with this example, that uniqueness MUST prevail between
> updates and MAY NOT be deferred.

There is no "in between" in Martijn's original examples and the nearly
equal example in Gulutzan's "SQL-00 complete, really".

It's just the atomicity of each SQL statement, which is the
core point.

> CREATE TABLE mydetails
> (
> INTCOL INTEGER NOT NULL
> )
> COMMIT;
> ALTER TABLE mydetails ADD CONSTRAINT xxx FOREIGN KEY (INTCOL) REFERENCES
> mytable (INTCOL) ON DELETE CASCADE ON UPDATE CASCADE;
> COMMIT;
> INSERT INTO mydetails VALUES (1);
> INSERT INTO mydetails VALUES (2);
> INSERT INTO mydetails VALUES (3);
> COMMIT;
>
> Now, what should happen upon the execution of the second UPDATE command?

By way of ON UPDATE CASCADE, all rows of mydetails get updated,
matching the updates in mytable. Where's the problem?

Regards,
Peter Jacobi