Re: [cx-oracle-users] Implicit Results interface in cx_Oracle
Brought to you by:
atuining
From: Shai B. <sh...@pl...> - 2015-03-01 02:42:00
|
Hi Krishna, I just happened to notice that PEP-249 defines a `nextset()` operation for multiple result sets. I suspect this is not exactly suitable for Oracle implicit result sets, but you should consider either using it or explaining in docs why you don't. It is currently not implemented by cx_Oracle, as far as I'm aware. Shai. On Friday 20 February 2015 08:15:46 Krishna Mohan IV wrote: > 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 > > --------------------------------------------------------------------------- > --- 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.clktr > k _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |