X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9E9A711F68DF for ; Tue, 18 Apr 2006 15:53:56 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 1.575 X-Spam-Level: * X-Spam-Status: No, score=1.575 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879, FROM_HAS_ULINE_NUMS=0.217] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id WXtylkTEeuoe for ; Tue, 18 Apr 2006 15:53:51 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web52501.mail.yahoo.com (web52501.mail.yahoo.com [206.190.48.184]) by postgresql.org (Postfix) with SMTP id 4730211F677C for ; Tue, 18 Apr 2006 15:53:52 -0300 (ADT) Received: (qmail 89202 invoked by uid 60001); 18 Apr 2006 18:53:51 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=eb/bHf0ZQoIc67W42rXvfj73VWwqxajSQevZMDS/lQaI2gn6KUphXYLiq5x7Hjx+HOk1AT6UQG/dvEKpt5Fsink7dQ06e6frepJX2D9Mvc1evjiFfUQYYYbHxazb2hxJpXdTROm3yNnuHZsTWdxYlKODmbBX74t2QXC/Z0fJvM0= ; Message-ID: <20060418185351.89200.qmail@web52501.mail.yahoo.com> Received: from [144.171.145.25] by web52501.mail.yahoo.com via HTTP; Tue, 18 Apr 2006 11:53:51 PDT Date: Tue, 18 Apr 2006 11:53:51 -0700 (PDT) From: Ash Grove Subject: Re: stored function, multiple queries, best practices To: pgsql-jdbc@postgresql.org In-Reply-To: <444198D6.4080805@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200604/132 X-Sequence-Number: 15066 --- Oliver Jowett wrote: > 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 > I know the combination of queries, but whether a parameter has a value is unknown. Also unknow is whether all relevant tables will get updated. If I simply send all parameters in a defined order, the parameter list will be kinda long and many values will be nulls. I can only call one function (from the application) per transaction, right? I don't mind doing the parsing, I was just wondering if I was considering all options. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com