psql - user defined SQL variables

Поиск
Список
Период
Сортировка
От Grainne Reilly
Тема psql - user defined SQL variables
Дата
Msg-id 6.0.3.0.0.20040817233150.00b233a8@mail.comcast.net
обсуждение исходный текст
Ответы Re: psql - user defined SQL variables  (Tino Wildenhain <tino@wildenhain.de>)
Re: psql - user defined SQL variables  (David Fetter <david@fetter.org>)
Список pgsql-general
I am new to PostgreSQL and am porting some scripts written for MySQL over
to psql.  There is one MySQL feature which I cannot find in psql - user
defined SQL variables. In MySQL I can use these to hold the result
(numeric, string or null) of a select: e.g.
select @count = count(*) from mytable;
The @count variable now holds the result of that select, and I can use it
in where clauses, updates, inserts  etc.
I checked out the \set psql variable but I haven't found a way to tweak it
to give me the result of a sql statement - is there any way to do that (I'm
using PostgreSQL version 7.4.3)?
Thanks in advance for any suggestions,
Grainne.



В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Any recommended forums/wiki/blog s/w that uses
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: psql - user defined SQL variables