Variables in Postgresql - Mailing list pgsql-general

From Tomas Eriksson
Subject Variables in Postgresql
Date
Msg-id 9fgaha$2409$1@news.tht.net
Whole thread Raw
Responses Re: Variables in Postgresql
Re: Variables in Postgresql
List pgsql-general
Hi.

I haven't seen any documentation about this, how do you use variables in a
simple way in postgresql? I want to use same sequence number in a dynamic
query from Perl.

When i'm using MSSQL i can do like this in a single query

"DECLARE @owner INT
INSERT maintable (fields) VALUES (...)
SELECT @owner = @@IDENTITY
INSERT subtable (fields) VALUES (@owner, ...)"

How does I save a value and using it later in the query..?

kind regards
Tomas



pgsql-general by date:

Previous
From: "Ahmet Temiz"
Date:
Subject:
Next
From: Lee Kwok Shing
Date:
Subject: PostgreSQL hangs when INSERT/UPDATE