From: | PegoraroF10 <marcos(at)f10(dot)com(dot)br> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: execute block like Firebird does |
Date: | 2018-05-30 12:50:59 |
Message-ID: | 1527684659736-0.post@n3.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2018-05-30 13:16:02 | Re: execute block like Firebird does |
Previous Message | Yavuz Selim Sertoğlu | 2018-05-30 11:37:05 | Query running for 12 hours |