You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested on WI-T3.0.0.31844, result in WI-V2.5.5.26871 is similar (just change row_number() to create sequence + gen_id).
SQL> recreate table s(id int, x int);
SQL> commit;
SQL> insert into s(id, x) select row_number()over(), 2 * row_number()over() from rdb$types rows 5;
SQL> commit;
SQL> select * from s;
ID X
============ ============
1 2
2 4
3 6
4 8
5 10
SQL> recreate table t(id int primary key, x int);
SQL> commit;
SQL> set count on;
SQL> merge into t using s on http://s.id = http://t.id when not matched then insert values(http://s.id, s.x);
Records affected: 5
SQL> select * from t;
ID X
============ ============
1 2
2 4
3 6
4 8
5 10
Records affected: 5
SQL> merge into t using s on http://s.id = http://t.id when matched then update set t.x = - 3 * s.x;
Records affected: 0 -- <<<<<<<<<<<<<<< ??? <<<<<<<<<<<<
-- Verify that last merge really changed target table:
SQL> select * from t;
Submitted by: @pavel-zotov
Assigned to: Claudio Valderrama C. (robocop)
Tested on WI-T3.0.0.31844, result in WI-V2.5.5.26871 is similar (just change row_number() to create sequence + gen_id).
SQL> recreate table s(id int, x int);
SQL> commit;
SQL> insert into s(id, x) select row_number()over(), 2 * row_number()over() from rdb$types rows 5;
SQL> commit;
SQL> select * from s;
============ ============
1 2
2 4
3 6
4 8
5 10
SQL> recreate table t(id int primary key, x int);
SQL> commit;
SQL> set count on;
SQL> merge into t using s on http://s.id = http://t.id when not matched then insert values(http://s.id, s.x);
Records affected: 5
SQL> select * from t;
============ ============
1 2
2 4
3 6
4 8
5 10
Records affected: 5
SQL> merge into t using s on http://s.id = http://t.id when matched then update set t.x = - 3 * s.x;
Records affected: 0 -- <<<<<<<<<<<<<<< ??? <<<<<<<<<<<<
-- Verify that last merge really changed target table:
SQL> select * from t;
============ ============
1 -6
2 -12
3 -18
4 -24
5 -30
Records affected: 5
Commits: 845120f b87075f FirebirdSQL/fbt-repository@4da3f9a
The text was updated successfully, but these errors were encountered: