Re: Implicit Results interface in cx_Oracle
Krishna Mohan IV <[email protected]> Fri, 20 Feb 2015 11:45:46 +0530
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
Shai, thanks for the inputs! We can as well make topcur.implicitresults() return a tuple that can be used in the same way you outlined here. That simplifies the implementation and I guess there is no extra benefit that an iterator provides the users in this case. thanks, krishna On 2/4/2015 1:19 AM, Shai Berger wrote: > Hi Krishna, > > This looks very interesting. Just one comment on the suggested API: > > On Tuesday 03 February 2015 13:36:10 Krishna Mohan IV wrote: >> Cursor.getnextimplicitresult() >> >> Fetch cursor for a unique resultset returned by a pl/sql function or >> procedure using dbms_sql.return_result. This function should be used >> when the Cursor. implicitresultcount is greater than 0. This routine >> should be called iteratively to get all the cursors returned by the >> PLSQL procedure. Fetching of rows for each of these cursor objects can >> be done using fetchall/ fetchmany/ fetchone . >> A Python none object is returned when no implicit results exist. >> > I would consider adding, from the get-go, an iterator for such cursors, as the > primary interface. Something like: > > for imprset in topcur.implicitresults(): > results = imprset.fetchall() > print results > > Note that, according to the docs, the result-sets can be fetched in parallel, > so something like this should also work: > > result_sets = list(topcur.implicitresults()) > results = zip(*result_sets) > > Have fun, > Shai. > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > cx-oracle-users mailing list > cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk