defining a variable - Mailing list pgsql-general

From luca.ciciriello@email.it
Subject defining a variable
Date
Msg-id d3046f7f157e420aafac52df812eef1b@85.18.140.153
Whole thread Raw
Responses Re: defining a variable  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
Hi All.

I need to create a sql script and launch it from pgadmin. In this script
some sql statements (INSERT) have to depend from the result of previous
statements (SELECT).
Is there a way to define a variable in SQL and set its value with the result
of a SELECT query?

Using the psql console I've used the command set var 'val'; and this
statement works fine.
Usising the same command from pgadmin an error is reported.

Im using postgres 8.2 on WindowsXp environment.

Thanks in advance.

Luca.
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f

 Sponsor:
 VOGLIA DI VACANZE ?
A Riccione i Family Hotels sono gli alberghi specializzati per le vacanze
dei bambini
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7983&d=20080612



pgsql-general by date:

Previous
From: Stefan Schwarzer
Date:
Subject: Re: pg_query & $result re-fill
Next
From: Alvaro Herrera
Date:
Subject: Re: Unable to dump database using pg_dump