MERGE Command - Using a sequence

Moderator: NorbertKrupa

Post Reply
User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

MERGE Command - Using a sequence

Post by Julie » Thu Aug 29, 2013 4:47 pm

Me again :lol:

Can we use a sequence in the MERGE command? I read the documentation, but I'm not sure I completely follow the explanation. It seems like it says we can if the table's column default is the next value from the sequence, but when I tried it, I get an error about not being able to use a sequence or identity.
Thanks,
Juliette

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: MERGE Command - Using a sequence

Post by id10t » Thu Aug 29, 2013 5:15 pm

Hi!
[...]Vertica can perform a MERGE operation if you omit the sequence from the query[...]
mean - no sequence as column in query at all.
[...]if you define column c1 as follows, Vertica can do a merge.

CREATE TABLE t (c1 INT DEFAULT s.nextval, c2 INT);
[...]
means that column C1 will insert or update it value with MERGE implicitly, i.e. from DEFAULT definition.

Post Reply

Return to “Vertica SQL”