merge statement gives error

From: Abhra Kar <abhra(dot)kar(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: merge statement gives error
Date: 2018-02-26 15:02:15
Message-ID: CAFNULEdVuT0WmCqM15_oOsuW3CS9g1oPdQQ8=MW+hH+-hvJkQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Trying to execute the following statement ----

merge into ABC as n using dual on (n.id=123)

when matched update set aaa=222, bbb=333

when not matched insert (id, aaa) values (NEXTVAL(id),555);

but gives syntax error.What should be the proper syntax[ Parameter values
are properly passed based on data type].

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Kazimiers 2018-02-26 15:18:07 Re: Unexpected behavior with transition tables in update statement trigger
Previous Message Łukasz Jarych 2018-02-26 13:08:19 Re: Creating complex track changes database - challenge!