1. Problem
- MERGE or UPSERT statement is throwing below error in IQ.
[SQL]
merge into gjang(id, name)
using gjang1 on gjang1.id = gjang.id
when not matched
then insert(id, name)
values(gjang1.id, gjang1.name)
when matched
then update set
gjang.name = gjang1.name,
gjang.id = gjang1.id
[Error]
E,1,-134,Feature 'MERGE INTO <remote_or_iq_table>' not implemented
2. Reproduction Steps
- Here are steps to reproduce.
1) create tables
create table gjang(id int, name char(10));
create table gjang1(id int, name char(10));
2) Execute Merge statement
merge into gjang(id, name)
using gjang1 on gjang1.id = gjang.id
when not matched
then insert(id, name)
values(gjang1.id, gjang1.name)
when matched
then update set
gjang.name = gjang1.name,
gjang.id = gjang1.id;
3. Solutions
- A Merge statement is included in latest ASE version.
( http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36272.1570/html/commands/... )
But IQ does not support MERGE/UPSERT yet.
So It can be implemented with insert / update statement.
Ex)
If condition1= true
then
update statement
else
insert statement
end if;
HTH
Gi-Sung Jang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Subject | Kudos |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User | Count |
---|---|
13 | |
10 | |
10 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |