PL/pgSQL doesn't support variables in queries?

Поиск
Список
Период
Сортировка
От J.A.
Тема PL/pgSQL doesn't support variables in queries?
Дата
Msg-id CALT+_gvfHtF5jqQg+J2suw3hOEh3ZWjZQDB8jJ945o4b1ekyyQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: PL/pgSQL doesn't support variables in queries?
Re: PL/pgSQL doesn't support variables in queries?
Список pgsql-general
Heya folks :)

ms-sql person here migrating over to pgsql. One of the first thing's I noticed with pgsql (or more specifically, PL/pgSQL) is that it doesn't support "variables" in a query?

for example, here's some T-SQL:

DECLARE @fkId INTEGER

SELECT @fkId = fkId FROM SomeTable WHERE id = 1

-- and then do something with that value..

SELECT * FROM AnotherTable WHERE Id = @fkId
SELECT * FROM YetAnotherTable WHERE FKId = @fkId
-- etc..

If I have this information correct, has this concept ever been discussed before or considered to be included in PL/pgSQL ?

Thank you kindly for any help/conversations on this topic.

Sincere apologies if this is not the correct forum/list to ask this question.

Regards,

JA.

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

Предыдущее
От: "Michael J. Baars"
Дата:
Сообщение: Re: libpq and multi-threading
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: PL/pgSQL doesn't support variables in queries?