agora inbox for pgsql-sql@postgresql.orghelp / color / mirror / Atom feed
Can the result sets produced in SQL procedures be left open for the use of the calling program? 2+ messages / 2 participants [nested] [flat]
* Can the result sets produced in SQL procedures be left open for the use of the calling program? @ 2017-06-01 21:15 Gugu Rama <gulsumramazanoglu@gmail.com> 0 siblings, 1 reply; 2+ messages in thread From: Gugu Rama @ 2017-06-01 21:15 UTC (permalink / raw) To: pgsql-sql Hi, May i ask, if I write an hll program and make a call to an sql procedure, will the result set which is produced in the sql procedure be available for the calling program, after the sql prodecure ends? Example: HLL program body (which undertakes frontend tasks, gets input from the user) . . . Call to an SQL procedure (all due backend stuff, which creates a result set depending on the input from the user) . . . HLL program body (sends the data in the result set to the screen) Thank you.. Gulsum ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Can the result sets produced in SQL procedures be left open for the use of the calling program? @ 2017-06-01 21:24 Adrian Klaver <adrian.klaver@aklaver.com> parent: Gugu Rama <gulsumramazanoglu@gmail.com> 0 siblings, 0 replies; 2+ messages in thread From: Adrian Klaver @ 2017-06-01 21:24 UTC (permalink / raw) To: Gugu Rama <gulsumramazanoglu@gmail.com>; pgsql-sql On 06/01/2017 02:15 PM, Gugu Rama wrote: > Hi, > > May i ask, if I write an hll program and make a call to an sql > procedure, will the result set which is produced in the sql procedure be > available for the calling program, after the sql prodecure ends? FYI, Postgres has User Defined Functions(UDF) not stored procedures: https://www.postgresql.org/message-id/D960CB61B694CF459DCFB4B0128514C26AB7AE%40exadv11.host.magwien.... Though it does not matter for this question. The answer is yes you can return a result set that can be consumed by another application. I do it all the time using Python as the end consumer. For the builtin language plpgsql see here: https://www.postgresql.org/docs/9.6/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURN... > > Example: > > HLL program body (which undertakes frontend tasks, gets input from the user) > . > . > . > Call to an SQL procedure (all due backend stuff, which creates a result > set depending on the input from the user) > . > . > . > HLL program body (sends the data in the result set to the screen) > > > Thank you.. > > Gulsum -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2017-06-01 21:24 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-06-01 21:15 Can the result sets produced in SQL procedures be left open for the use of the calling program? Gugu Rama <gulsumramazanoglu@gmail.com> 2017-06-01 21:24 ` Adrian Klaver <adrian.klaver@aklaver.com>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox