Subject | Re: [firebird-support] doing cascade update manually? |
---|---|
Author | Martijn Tonies |
Post date | 2003-12-13T16:53:04Z |
Hi David,
As you might have noticed, constraints are not deferred
until "commit" time. So if, while updating, you are violating
any constraints, the update will fail. So there's no way to
do this.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> create table t1 (id int not null primary key, i int, unique(i));well).
> create table t2 (id int not null primary key, i int references t1(i));
>
> insert into t1 values (1,1);
> insert into t1 values (2,2);
> insert into t2 values (1,1);
>
> t2(i) is not declared 'cascade update'. Can I update t1(i) like this
>
> update t1 set i=3 where id=1;
>
> as well as updating t2(i)? In other words, I want to do cascade
> manually/case-by-case in this situation (sometimes I want to forbid
> changes to a referenced unique column, and sometimes I want to allow
> that change and propagating the changes to all referencing columns as
As you might have noticed, constraints are not deferred
until "commit" time. So if, while updating, you are violating
any constraints, the update will fail. So there's no way to
do this.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com