defining a variable

From: luca(dot)ciciriello(at)email(dot)it
To: pgsql-general(at)postgresql(dot)org
Subject: defining a variable
Date: 2008-06-12 13:37:28
Message-ID: d3046f7f157e420aafac52df812eef1b@85.18.140.153
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Schwarzer 2008-06-12 13:53:55 Re: pg_query & $result re-fill
Previous Message Alvaro Herrera 2008-06-12 13:32:23 Re: array column and b-tree index allowing only 8191 bytes