(8.0.26)
調べた限りない模様
(19c)
drop table tab1 purge;
create table tab1(col1 int primary key,col2 int);
insert into tab1 values(1,1);
insert into tab1 values(1,1);
select * from tab1;
--
drop table tab2 purge;
create table tab2(col1 int primary key DEFERRABLE INITIALLY DEFERRED,col2 int);
insert into tab2 values(1,1);
insert into tab2 values(1,1);
select * from tab1;
もともと文レベルで遅延が有効になっている。
トランザクションレベルで遅延が有効になる★
(14)
https://qiita.com/ariaki/items/9c9cee0cc763964a4ed2
drop table tab1;
create table tab1(col1 int primary key,col2 int);
insert into tab1 values(1,1);
insert into tab1 values(2,2);
select * from tab1;
update tab1 t1 set col1=(select case when t2.col1=1 then 2 when t2.col1=2 then 1 end from tab1 t2 where t1.col1=t2.col1);
--
drop table tab2;
create table tab2(col1 int primary key DEFERRABLE INITIALLY DEFERRED,col2 int);
insert into tab2 values(1,1);
insert into tab2 values(2,2);
select * from tab2;
update tab2 t1 set col1=(select case when t2.col1=1 then 2 when t2.col1=2 then 1 end from tab2 t2 where t1.col1=t2.col1);
文レベルで遅延が有効になる★
(2019)
調べた限りない模様