Re: Multi-row update w. plpgsql function - Mailing list pgsql-general

From Daniel Hertz
Subject Re: Multi-row update w. plpgsql function
Date
Msg-id 43A0B8CC.5050005@shaw.ca
Whole thread Raw
In response to Re: Multi-row update w. plpgsql function  (Aaron Koning <aaronkoning@gmail.com>)
List pgsql-general
Aaron Koning wrote:
> This might be easier to use this SQL:
>      UPDATE message_table SET status = 'A' WHERE mid IN (1,2,3);
>
> The following might work for Cocoon (never used it):
>      UPDATE message_table SET status = 'A' WHERE mid IN
> (<xsp-request:get-parameter name="approved"/>);
>
> Aaron
>
>
>
> On 12/13/05, Daniel Hertz <danielhertz@shaw.ca> wrote:
>
>> Given a set of checkbox values that are submitted through an html form,
>> how do you loop through the submitted values to update more than one row
>> in a table?
>>

You rock, Aaron! Thanks for helping this newbie out. Much more
economical than looping with my function.

The (<xsp-request:get-parameter name="approved"/>) isn't working, but
I'll try to see if I can use some xslt to parse the query string and
replace a variable ($approved_values) in:

UPDATE message_table SET status = 'A' WHERE mid IN ($approved_values);

If I new some javascript, I could probably do it client side, BEFORE it was sent to the server, but SIGH...I'm a
graphicdesigner with little coding skill. 

Thanks again.

Daniel



pgsql-general by date:

Previous
From: "Siddharth Rath -X \(sirath - Keane, Inc. at Cisco\)"
Date:
Subject: unsubscribe pgsql-genera
Next
From: Jerry LeVan
Date:
Subject: Re: Installing the latest 8.1.1 rpms question.