MERGE Statement is not working in Informix v10

只谈情不闲聊 提交于 2020-12-13 03:59:25

问题


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?


回答1:


The MERGE statement was not available in Informix 10.00. It was added in 11.50 — see the MERGE statement in the SQL syntax manual. The new features page suggests it was added in 11.50.xC6, part of the way through the maintenance release cycle.

Note that version 10.00 and all the 11.x versions (11.10, 11.50, 11.70) are unsupported. Version 11.70 went out of support on 2020-10-01.



来源:https://stackoverflow.com/questions/64630365/merge-statement-is-not-working-in-informix-v10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!