X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AE8AB9DC94C for ; Wed, 14 Dec 2005 20:47:13 -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 37403-03 for ; Wed, 14 Dec 2005 20:47:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mout.perfora.net (mout.perfora.net [217.160.230.40]) by postgresql.org (Postfix) with ESMTP id 838E39DC830 for ; Wed, 14 Dec 2005 20:47:11 -0400 (AST) Received: from [68.146.21.5] (helo=[192.168.0.100]) by mrelay.perfora.net (node=mrelayus1) with ESMTP (Nemesis), id 0MKp2t-1EmhH70YvG-0002ub; Wed, 14 Dec 2005 19:47:15 -0500 Message-ID: <43A0BCD4.7050809@shaw.ca> Date: Wed, 14 Dec 2005 17:46:12 -0700 From: Daniel Hertz Reply-To: danielhertz@shaw.ca User-Agent: Mail/News 1.5 (Windows/20051206) MIME-Version: 1.0 To: "postgreSQL (SQL)" Subject: Re: Multi-row update w. plpgsql function References: <144D12D7DD4EC04F99241498BB4EEDCC18FFE2@nelson.osl.com> <1319fbba0512131804v55dd3f24h3cddf5b10ef70a0c@mail.gmail.com> In-Reply-To: <1319fbba0512131804v55dd3f24h3cddf5b10ef70a0c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: perfora.net abuse@perfora.net login:cf1ae69d888cbe19591da5d2fe7fee64 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/126 X-Sequence-Number: 23668 Aaron Koning wrote: > Owen makes a good point. Check that you are using the [] in the HTML input > variable for the checkboxes. Like: > > 1
> 2
> 3
> 4
> > Aaron > > On 12/13/05, Owen Jacobson wr >> I'm not familiar with Cocoon, but I'd expect that to return only the first >> of the "approved" values from the HTTP request. If you add logging to the >> stored function (RAISE NOTICE 'approved: %', approved; near the start of the >> function, for instance) and tell PostgreSQL to store the logs, you can see >> what values your function is actually being called with. >> >> What you really want to do is begin a transaction, loop over all the >> values of approved present in the form data and call (the rewritten version >> of) update_messages for each one, then commit the transaction. >> >> -Owen Thank you all, so much, for taking the time to help me out. Especially as a beginner, where coding IS rocket science. On the general board, Aaron mentioned: UPDATE message_table SET status = 'A' WHERE mid IN (1,2,3); which seems very succinct and economical. I'm gonna have a go at parsing the query string using XSLT, substituting the variable for: UPDATE message_table SET status = 'A' WHERE mid IN ($query_values_here); Again, thanks for the help, Daniel