Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "merge".

From: Vinodh NV <linktovinodh(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "merge".
Date: 2018-03-07 09:26:32
Message-ID: CAMBHpRjk1OxbYDRw1-cs_8LyKJ23LrXuiitmqaVJLJBJ7ckKvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sir,

I am facing the error Caused by: org.postgresql.util.PSQLException: ERROR:
syntax error at or near "merge". when I execute the below query in
postgres database. The same works fine in Oracle.

merge into net n using dual on (n.id=:id) when matched then update set
Status=:status, lastStatusDate=:lastStatusDate, errorMessage=:errorMessage,
errorDetails=:errorDetails when not matched then insert (id,Status,
lastStatusDate, errorMessage, errorDetails) values
(:id,:status,:lastStatusDate,:errorMessage,:errorDetails)";

Can you please let me know how to resolve it?

Thanks,
Vinodh.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-07 09:34:44 Re: Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "merge".
Previous Message Murtuza Zabuawala 2018-03-07 07:24:38 Re: save query as sql file