Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 92D5B9FB4FA for ; Sun, 1 Jul 2007 09:32:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 36364-04 for ; Sun, 1 Jul 2007 09:32:19 -0300 (ADT) X-Greylist: delayed 00:29:03.362652 by SQLgrey-1.7.5 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 9B8489FB724 for ; Sun, 1 Jul 2007 09:32:24 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from smtp-out.kontent.com (smtp-out001.kontent.com [81.88.40.215]) by svr4.postgresql.org (Postfix) with ESMTP id 56E845AF889 for ; Sun, 1 Jul 2007 12:03:20 +0000 (GMT) Received: from jedi.behrens.de (p57B42F5E.dip0.t-ipconnect.de [87.180.47.94]) by smtp-out.kontent.com (Postfix) with ESMTP id B3BA537C115 for ; Sun, 1 Jul 2007 14:03:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by jedi.behrens.de (Postfix) with ESMTP id 0FB232BC76 for ; Sun, 1 Jul 2007 14:03:16 +0200 (CEST) Received: from jedi.behrens.de ([127.0.0.1]) by localhost (jedi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29480-01 for ; Sun, 1 Jul 2007 14:03:15 +0200 (CEST) Received: from [192.168.150.239] (mac.behrens.de [192.168.150.239]) by jedi.behrens.de (Postfix) with ESMTP id 613CB2389D for ; Sun, 1 Jul 2007 14:03:15 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v624) Content-Transfer-Encoding: 7bit Message-Id: <4802078e6d43acd33ae04dc0f8a652b3@lollisoft.de> Content-Type: text/plain; charset=US-ASCII; format=flowed To: pgsql-odbc@postgresql.org From: Lothar Behrens Subject: declaring variable ? Date: Sun, 1 Jul 2007 14:03:14 +0200 X-Mailer: Apple Mail (2.624) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200707/1 X-Sequence-Number: 9056 Hi, 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 here') I didn't find such a syntax in the documentation. Regards, Lothar -- Lothar Behrens | Rapid Prototyping ... Heinrich-Scheufelen-Platz 2 | 73252 Lenningen | www.lollisoft.de