From: Roger Mathis <traderx@gmx.ch>
To: pgsql-sql@postgresql.org
Subject: Variables in PSQL
Date: Mon, 8 Jul 2002 15:24:18 +0200
Message-ID: <3d299272$0$1005$7402020d@newsfeed.sunrise.ch> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: traderx@gmx.ch
Subject: Re: Variables in PSQL
In-Reply-To: <3d299272$0$1005$7402020d@newsfeed.sunrise.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox