Re: [cx-oracle-users] Implicit Results interface in cx_Oracle
Brought to you by:
atuining
From: Krishna M. IV <kri...@or...> - 2015-02-20 06:15:59
|
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-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |