Skip site navigation (1) Skip section navigation (2)

Re: DELETE ... RETURNING

From: Dennis Brakhane <brakhane(at)googlemail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: DELETE ... RETURNING
Date: 2009-07-13 19:51:01
Message-ID: 226a19190907131251m6c3786f5id8e8025f5c53cf66@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Mon, Jul 13, 2009 at 9:44 PM, Thomas Kellerer<spam_eater(at)gmx(dot)net> wrote:
> Statement stmt = connection.createStatement();
> stmt.executeUpdate("delete from person where firstname like 'A%' returning
> id");
>
> Am I missing something or is the "RETURNING" feature not supported by the
> driver?

executeUpdate by definitionem can only return an int, the number of
rows affected.

You probably can use stmt.executeQuery instead

In response to

Responses

pgsql-jdbc by date

Next:From: Thomas KellererDate: 2009-07-13 20:23:04
Subject: Re: DELETE ... RETURNING
Previous:From: Thomas KellererDate: 2009-07-13 19:44:57
Subject: DELETE ... RETURNING

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group