variables outside of functions - Mailing list pgsql-novice

From Ketema J. Harris
Subject variables outside of functions
Date
Msg-id CEC4D037-DE18-465D-9D75-F965ADE9D543@ketema.net
Whole thread Raw
Responses Re: variables outside of functions
List pgsql-novice
Is it possible to write a block of sql statements that utilize variables?  I can use variables easy enough inside of a function, but I was attempting to do something very transactSQL like and kepte running into problems.  I would like to do something similar to:

declare
var1 int;
var2 int;
var3 int;

begin
var3 = var1 + var2;
select var3 as addition;
end

is this possible?  Thanks.

Ketema J. Harris
www.ketema.net


Attachment

pgsql-novice by date:

Previous
From: Charley Tiggs
Date:
Subject: Re: Insert Text
Next
From: Dyanesh NagarajaRao
Date:
Subject: Postgres Installation problem.