Merge on table having Identity Column
I want to perform a merge insert onto a table which has Identity column. The merge will be based on another column within the target table but target table do have identity column in it.
0
I want to perform a merge insert onto a table which has Identity column. The merge will be based on another column within the target table but target table do have identity column in it.
Comments
Hi,
Since the target table has an IDENTITY, you'll have to do the merge manually with and UPDATE statement followed by an INSERT statement.
Example:
So Does this means that vertica do not support merge insert for tables having identity column in it.?
Yes. That's why in my example I got the error message: "ERROR 4711: Sequence or IDENTITY/AUTO_INCREMENT column in merge query is not supported"
Hello
We get same error when the MERGE is on a table having a column with a DEFAULT VALUE based on a sequence .... (not defined as Identity) . We turned to merge to avoid problems with Updates , but now we hit another problem.... Is there any workaround since 2018 (date of last post here)
Thanks
Isabelle
Hi Isabelle -
Yes , this remains the same.
DEFAULT sequencename.nextval
has the same behaviour as an IDENTITY column.