selecting into a variable like @var=select ...

From: joseph speigle <joe(dot)speigle(at)jklh(dot)us>
To: pgsql-general(at)postgresql(dot)org
Subject: selecting into a variable like @var=select ...
Date: 2003-12-16 17:12:17
Message-ID: 20031216171217.GA5193@www.sirfsup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hello list,

I want to do something like the following:

address=# @var = select max(id) from passwd;
ERROR: parser: parse error at or near "@" at character 1
address=# var = select max(id) from passwd;
ERROR: parser: parse error at or near "var" at character 1
address=# :var = select max(id) from passwd;
ERROR: parser: parse error at or near ":" at character 1
address=#

so that I could then issue

create sequence passwd_id_seq start @var increment 1

how can I declare and capture output into this variable? Or, should I create a function, if it is possible to issue a "create" statement inside a procedure body?

--
joe speigle

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rick Gigger 2003-12-16 17:31:05 Re: add column sillyness
Previous Message Michael Fuhr 2003-12-16 17:09:02 Re: Authentication Question