Re: execute block like Firebird does

Поиск
Список
Период
Сортировка
От PegoraroF10
Тема Re: execute block like Firebird does
Дата
Msg-id 1527684659736-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на execute block like Firebird does  (PegoraroF10 <marcos@f10.com.br>)
Ответы Re: execute block like Firebird does  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: execute block like Firebird does  (Félix GERZAGUET <felix.gerzaguet@gmail.com>)
Список pgsql-general
Some time ago I´ve posted this thread because we had lots of these execute
blocks to be translated to Postgres. Now, continuing on same matter, I would
like to discuss the same topic, basically calling the server one time only,
instead of several times.
Usually we want get some values from server and then insert or update some
records based on that returned values. Each of these calls will spend time
and this is the point I would like to discuss.

How to send a script to server and return one or more values from that
execution ?

You´ll probably answer me that I could solve that with a function. But
suppose those executions are dynamic, depends on businness rules or any
other problem.

So, is that possible to change a DO structure is ran, to be possible to
return one or more values ?
It would be like ...
DO returns(ID Integer, Description Text) as
$$
begin
  select ...
  insert ...
  select ... into ID, Description
end
$$

Using this way would be possible to create that script on client, call it
just one time and have a result for that execution, exactly the way a
"execute block" does on Firebird.

Is that possible or there is a way to call just one time the server to
return values without creating a function to each call ?

What do you think change how DO structure is ran to have results from ?
Version 12, what do you think ?



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


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

Предыдущее
От: Yavuz Selim Sertoğlu
Дата:
Сообщение: Query running for 12 hours
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: execute block like Firebird does