X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6A3F3538B6 for ; Fri, 29 Apr 2005 05:44:36 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56809-10 for ; Fri, 29 Apr 2005 08:44:33 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 57FF753792 for ; Fri, 29 Apr 2005 05:44:32 -0300 (ADT) Received: (qmail 16403 invoked by uid 1112); 29 Apr 2005 08:44:35 -0000 Date: Fri, 29 Apr 2005 03:44:35 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Dave Minter Cc: pgsql-jdbc@postgresql.org Subject: Re: CallableStatement problem...? In-Reply-To: <20050426190737.mcn8ksk404cwwk4w@webmail.spamcop.net> Message-ID: References: <20050426190737.mcn8ksk404cwwk4w@webmail.spamcop.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/210 X-Sequence-Number: 12817 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