You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While fetching data from executed query result . Currently ibm_db supports fetch_row, fetch_tuple, fetch_both, fetch_assoc.All these functions fetches one row at a time. It needs to be looped (while, for) to fetch more than one row, till end of result.Looping will decrease then performance of fetch and developer needs to code additional steps (i.e, looping) for achieving multiple row fetch .
fetch_row:
row = ibm_db.fetch_row(result)
while ( row ):
row = ibm_db.fetch_row(result)
fetch_tuple:
row = ibm_db.fetch_tuple(result)
while ( row ):
row = ibm_db.fetch_tuple(result)
fetch_both:
row = ibm_db.fetch_both(result)
while ( row ):
row = ibm_db.fetch_both(result)
fetch_assoc:
row = ibm_db.fetch_assoc(result)
while ( row ):
row = ibm_db.fetch_assoc(result)
Enhancement Request:
Python DB API (ibm_db_dbi) supports fetchall and fetchmany to retrieve rows from a database table.
It provides greater flexiblity to end user on how many rows needs to be fetched at a time without need of looping.
Since looping is eliminated, it will significantly increases fetch performance and developer can skip additional coding steps (i.e, looping) for achieving multiple row fetch .
fetchall():
fetches all the rows of a query result. It returns all the rows as a list of tuples. An empty list is returned if there is no record to fetch.
fetchmany(size):
returns the number of rows specified by size argument. When called repeatedly, this method fetches the next set of rows of a query result and returns a list of tuples.If no more rows are available, it returns an empty list.
Kindly please consider enhancing ibm_db to support fetchall and fetchmany functions, as it provides greater flexibility to end user.
The text was updated successfully, but these errors were encountered:
Problem Statement:
While fetching data from executed query result . Currently ibm_db supports fetch_row, fetch_tuple, fetch_both, fetch_assoc.All these functions fetches one row at a time. It needs to be looped (while, for) to fetch more than one row, till end of result.Looping will decrease then performance of fetch and developer needs to code additional steps (i.e, looping) for achieving multiple row fetch .
fetch_row:
fetch_tuple:
fetch_both:
fetch_assoc:
Enhancement Request:
Python DB API (ibm_db_dbi) supports fetchall and fetchmany to retrieve rows from a database table.
It provides greater flexiblity to end user on how many rows needs to be fetched at a time without need of looping.
Since looping is eliminated, it will significantly increases fetch performance and developer can skip additional coding steps (i.e, looping) for achieving multiple row fetch .
fetchall():
fetches all the rows of a query result. It returns all the rows as a list of tuples. An empty list is returned if there is no record to fetch.
fetchmany(size):
returns the number of rows specified by size argument. When called repeatedly, this method fetches the next set of rows of a query result and returns a list of tuples.If no more rows are available, it returns an empty list.
Kindly please consider enhancing ibm_db to support fetchall and fetchmany functions, as it provides greater flexibility to end user.
The text was updated successfully, but these errors were encountered: