Skip site navigation (1) Skip section navigation (2)

declaring variable ?

From: Lothar Behrens <lothar(dot)behrens(at)lollisoft(dot)de>
To: pgsql-odbc(at)postgresql(dot)org
Subject: declaring variable ?
Date: 2007-07-01 12:03:14
Message-ID: (view raw or whole thread)
Lists: pgsql-odbc

I am searching for a way to do the following (MS SQL) in PostgreSQL:

declare @key as int

set @key = (select ID from table1 where name = '...')

insert into table2 (foreignkey, foreignvalue) values(@key, 'some value 

I didn't find such a syntax in the documentation.

Regards, Lothar

Lothar Behrens				|	Rapid Prototyping ...
Heinrich-Scheufelen-Platz 2		|	
73252 Lenningen  				|

pgsql-odbc by date

Next:From: Nardmann, HeikoDate: 2007-07-05 09:54:37
Subject: ChangeLog?
Previous:From: Mark Cave-AylandDate: 2007-06-29 13:42:48
Subject: Re: Proposal for new pgsqlODBC feature- hiding tables inaccessible to the current user

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group