
Key: |
CORE-4796
|
Type: |
Bug
|
Status: |
Open
|
Priority: |
Major
|
Assignee: |
Unassigned
|
Reporter: |
Pavel Zotov
|
Votes: |
0
|
Watchers: |
3
|
If you were logged in you would be able to see more operations.
|
|
|
WI-T3.0.0.31839:
=============
SQL> create table tdetl(id int constraint tdetl_pk primary key, pid int); commit;
SQL> set count on;
SQL> merge into tdetl t using ( select 5 as id, 1 as pid from rdb$types rows 2 ) s
CON> on t.id=s.id
CON> when matched then update set t.pid = s.pid
CON> when not matched then insert values( s.id, s.pid);
Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "TDETL_PK" on table "TDETL"
-Problematic key value is ("ID" = 5)
Records affected: 1
WI-V2.5.5.26870:
=============
SQL> set count on;
SQL> merge into tdetl t using ( select 5 as id, 1 as pid from rdb$types rows 2 ) s on t.id=s.id when matched then update set t.pid
= s.pid when not matched then insert values( s.id, s.pid);
Records affected: 1
SQL> select * from tdetl;
ID PID
============ ============
5 1
Records affected: 1
SQL>
|
Description
|
WI-T3.0.0.31839:
=============
SQL> create table tdetl(id int constraint tdetl_pk primary key, pid int); commit;
SQL> set count on;
SQL> merge into tdetl t using ( select 5 as id, 1 as pid from rdb$types rows 2 ) s
CON> on t.id=s.id
CON> when matched then update set t.pid = s.pid
CON> when not matched then insert values( s.id, s.pid);
Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "TDETL_PK" on table "TDETL"
-Problematic key value is ("ID" = 5)
Records affected: 1
WI-V2.5.5.26870:
=============
SQL> set count on;
SQL> merge into tdetl t using ( select 5 as id, 1 as pid from rdb$types rows 2 ) s on t.id=s.id when matched then update set t.pid
= s.pid when not matched then insert values( s.id, s.pid);
Records affected: 1
SQL> select * from tdetl;
ID PID
============ ============
5 1
Records affected: 1
SQL> |
Show » |
|