I tried to use the merge statement to Insert/Update in Informix v10.0 but it throws a Syntax Error:
create table source(id int, account int, age int);
create table target (id int, account int, age int);
insert into source values(1, 1200, 25);
insert into source values(2, 1300, 28);
insert into source values(3, 1400, 45);
merge into target t
using source s on t.id = s.id
when matched then
update
set t.id = s.id, t.account = s.account, t.age = s.age
when not matched then
insert (t.id, t.account, t.age)
values (s.id, s.account, s.age);
select * from target;
Could you please help?