Re: Stored Procedure Record Updates using For Loops - Postgres 8.1 - Mailing list pgsql-general

From Lummis, Patrick J
Subject Re: Stored Procedure Record Updates using For Loops - Postgres 8.1
Date
Msg-id 05BB196AB3DA6C4BBE11AB6C957581FE438CA468@sfo-exch-01.dolby.net
Whole thread Raw
In response to Re: Stored Procedure Record Updates using For Loops - Postgres 8.1  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
Indeed there is an id field. That's the ticket!

And thanks much.

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Tuesday, February 28, 2012 12:48 PM
To: pgsql-general@postgresql.org
Cc: Lummis, Patrick J; Bartosz Dmytrak
Subject: Re: [GENERAL] Stored Procedure Record Updates using For Loops -
Postgres 8.1

On Tuesday, February 28, 2012 12:35:58 pm Lummis, Patrick J wrote:
> Hi Bartek,
>
> Thanks for the quick response.
>
> Syntax error cleared up and loads fine but executing the stored
> procedure fails to update the row.

From the usage I guessing this function is not being used in a trigger.
As such the ROW variable exists outside the table. If you want to UPDATE
the table you are going to have to do a hybrid of what you have:

update workorder set wfstatus='failed' where id=workorderRecord.id

assuming there is an 'id' field of some sort.


>
> Regards,
>
> Patrick

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: dennis jenkins
Date:
Subject: Re: accumulating handles problem on machine running postgresql
Next
From: Andy Colson
Date:
Subject: Re: strategies for dealing with frequently updated tables