Re: Attribute a value to a record

From: Florent THOMAS <mailinglist(at)tdeo(dot)fr>
To: postgesql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Attribute a value to a record
Date: 2010-02-03 13:40:12
Message-ID: 1265204412.18031.25.camel@Dell_Inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le mercredi 03 février 2010 à 14:38 +0100, Florent THOMAS a écrit :

> Thank you,
>
> As I posted on a french list, whene I start to develop trigger bigger
> than 10lines, I always come back on developper habits and forget
> database aspects.
> So I WILL PRINT IT ON MY WALL : With records everything is temporary.
>
> Best regards and sorry for the english!
>
>
>
> Le mercredi 03 février 2010 à 14:13 +0100, Albe Laurenz a écrit :
>
> > Florent THOMAS wrote:
> > > I understood that in the Loop you can change the values of a
> > > variable! Exactly what I needed.
> > > but unfortunately all of this seems to be temporary.
> > > Consequently, the record in the table won't be updated by the
> > > changes we made on the local variable even if it points to a
> > > record in the table.
> > > I forgot the aspect of the cursor that is temporary.
> >
> > I get you now - you expected that the underlying table would
> > be updated if you change a variable in PL/pgSQL.
> >
> > I don't think that you need dynamic SQL for that -
> > all it takes is an UPDATE statement in your loop, like
> >
> > UPDATE XXX SET XXX.myfield = mynewvalue
> > WHERE XXX.pkey = ventilation_local.pkey;
> >
> > (using the names from your sample)
> >
> > Yours,
> > Laurenz Albe
> >

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Florent THOMAS 2010-02-03 13:42:10 Re: Attribute a value to a record
Previous Message Wappler, Robert 2010-02-03 13:33:17 Re: Attribute a value to a record