Variables in PSQL

From: "Roger Mathis" <traderx(at)gmx(dot)ch>
To: pgsql-sql(at)postgresql(dot)org
Subject: Variables in PSQL
Date: 2002-07-08 13:24:18
Message-ID: 3d299272$0$1005$7402020d@newsfeed.sunrise.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Narendra A 2002-07-08 14:28:50 is there a way to get hh:mm:ss given seconds
Previous Message Christoph Haller 2002-07-08 12:54:00 Re: Double quotes?