MERGE 语句在 Informix v10 中不起作用

MERGE Statement is not working in Informix v10

我尝试在 Informix v10.0 中使用 Insert/Update 的合并语句 但它抛出语法错误:

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;

你能帮忙吗?

MERGE 语句在 Informix 10.00 中不可用。它是在 11.50 中添加的 — 请参阅 MERGE statement in the SQL syntax manual. The new features 页面表明它是在 11.50.xC6 中添加的,这是维护发布周期的一部分。

请注意,版本 10.00 和所有 11.x 版本(11.10、11.50、11.70)均不受支持。版本 11.70 于 2020 年 10 月 1 日停止支持。