X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 2144711F8B8A for ; Sat, 15 Apr 2006 22:08:02 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -0.691 X-Spam-Level: X-Spam-Status: No, score=-0.691 required=5 tests=[AWL=1.908, BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id g+nNTGN61omM for ; Sat, 15 Apr 2006 22:07:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id DA5B411F8AAA for ; Sat, 15 Apr 2006 22:07:51 -0300 (ADT) Received: from 221x253x225x162.ap221.ftth.ucom.ne.jp ([221.253.225.162] helo=[192.168.1.210]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1FUvju-0005Xw-Gp; Sun, 16 Apr 2006 13:07:46 +1200 Message-ID: <444198D6.4080805@opencloud.com> Date: Sun, 16 Apr 2006 10:07:34 +0900 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ash Grove CC: pgsql-jdbc@postgresql.org Subject: Re: stored function, multiple queries, best practices References: <20060414143720.5342.qmail@web52512.mail.yahoo.com> In-Reply-To: <20060414143720.5342.qmail@web52512.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/111 X-Sequence-Number: 15045 Ash Grove wrote: > >>Why assemble a string and parse it? Why not just use >>multiple parameters >>directly? >>-O > > > > So, Oliver, you're suggesting something like "call > myfunction('query1','query2','query3')"? No, I'm suggesting: call myfunction('data value 1', 42, 1.234, 'data value 4') I am assuming you know the combinations of updates you will need to run ahead of time. If you want to run arbitary queries then you are probably stuck with doing some parsing in the function .. but that is pretty nasty. -O