X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8249D9DCC2C for ; Mon, 13 Feb 2006 19:02:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49104-07 for ; Mon, 13 Feb 2006 19:02:44 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (unknown [66.48.31.89]) by postgresql.org (Postfix) with SMTP id 11C5C9DCC2A for ; Mon, 13 Feb 2006 19:02:39 -0400 (AST) Received: (qmail 29130 invoked by uid 1112); 13 Feb 2006 23:02:42 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 13 Feb 2006 23:02:42 -0000 Date: Mon, 13 Feb 2006 18:02:42 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Guy Rouillier cc: PostgreSQL Interfaces , pgsql-jdbc@postgresql.org Subject: Re: JDBC support for CALL / PERFORM In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.103 required=5 tests=[AWL=0.103] X-Spam-Score: 0.103 X-Spam-Level: X-Archive-Number: 200602/48 X-Sequence-Number: 6012 On Mon, 13 Feb 2006, Guy Rouillier wrote: > I have some Java code that I'm trying to convert from Oracle to PG. > This code uses the JDBC batch functionality to submit batches of stored > procedures invocations using the "call" syntax. I implemented the same > stored functions in PG, having them return void. I converted the batch > statements to use "select" with these stored functions. Even though the > stored functions return void, the select is still producing a result > set, and JDBC does not allow results with batches. > > I'd like to take a crack at adding CALL (for Oracle and general JDBC > compatibility) and/or PERFORM (for PL/SQL compatibility) to the JDBC > driver. My approach would be to simply substitute SELECT, then discard > the result set upon completion. You shouldn't need to do anything other than discard the results instead of erroring for CallableStatement batches. You shouldn't do any messing with the SQL and CALL or PERFORM. This should be handled by the standard {call } syntax. Also JDBC messages should go to the jdbc list, pgsql-jdbc@postgresql.org. Kris Jurka