Re: [cx-oracle-users] Implicit Results interface in cx_Oracle
Brought to you by:
atuining
From: Shai B. <sh...@pl...> - 2015-02-03 19:49:47
|
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. |