Variables in PSQL - Mailing list pgsql-sql

From Roger Mathis
Subject Variables in PSQL
Date
Msg-id 3d299272$0$1005$7402020d@newsfeed.sunrise.ch
Whole thread Raw
Responses Re: Variables in PSQL  (Christoph Haller <ch@rodos.fzk.de>)
List pgsql-sql
Hi

I'm trying to declare a variable in PostgreSQL, so I can save some values in
it. After, I want to calculate with this variable.
For example:

declare vp integer;
select price into :vp from article where anr = 1;
vp := vp + 1;
update article set price = :vp where anr = 1;

Is there a posibility to do that without creating a funktion?
Thanks for your answers.

CU Roger






pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Re: newbie question
Next
From: Tom Lane
Date:
Subject: Re: Rule WHERE condition problem