initialize and use variable in query

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема initialize and use variable in query
Дата
Msg-id CAKFQuwanKATk5AUrU5HHeZ2kiWM=Znk3mZBQapF_y2x2BHZ3cg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: initialize and use variable in query  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: initialize and use variable in query
Список pgsql-general
On Saturday, December 29, 2018, Ray O'Donnell <ray@rodonnell.ie> wrote:
A couple of things off the top of my head:

Sorry but, no. 

(i) I think you need "language plpgsql" (or whatever) after the DO block.

As the docs state plpgsql is the default for a DO block lacking a language specifier. 


(ii) That assignment in the DO should probably be:

  select max(fctrdt) into startdate from fnmloan;

The original form is perfectly valid plpgsql;

The DO block worked just fine.  It’s just that everything it did was discarded at the end of it because nothing that permanently affected the parent SQL session happened.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: initialize and use variable in query
Следующее
От: Glenn Schultz
Дата:
Сообщение: Re: initialize and use variable in query