From: Kris Jurka <books@ejurka.com>
To: Dave Minter <dave@paperstack.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: CallableStatement problem...?
Date: Fri, 29 Apr 2005 03:44:35 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0504290339200.7352@leary.csoft.net> (raw)
In-Reply-To: <20050426190737.mcn8ksk404cwwk4w@webmail.spamcop.net>
References: <20050426190737.mcn8ksk404cwwk4w@webmail.spamcop.net>
On Tue, 26 Apr 2005, Dave Minter wrote:
>
> I'm puzzled. I'm trying to invoke a PG/plSQL function as a callable
> statement. The function takes one parameter, inserts it into a table,
> and returns. Since I'm not selecting anything and I have no (or rather,
> only a void) return parameter, I expected to be able to call
> executeUpdate() on the CS to have this take effect - but I get this
> error message:
>
> org.postgresql.util.PSQLException:
> A result was returned when none was expected.
>
> If I call executeQuery, then it works perfectly (but that causes
> problems with a 3rd party tool I'm using which expects a pure-insertion
> sproc to be comfortable with a call to executeUpdate).
This is how the driver works, it replaces {call myfunc()} with SELECT *
FROM myfunc, which will always return a ResultSet. It seems we could
special case CallableStatements version to expect and ignore a result when
executeUpdate is called.
Kris Jurka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, dave@paperstack.com
Subject: Re: CallableStatement problem...?
In-Reply-To: <Pine.BSO.4.56.0504290339200.7352@leary.csoft.net>
References: <20050426190737.mcn8ksk404cwwk4w@webmail.spamcop.net> <Pine.BSO.4.56.0504290339200.7352@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox