iterating using fetchmany

"Rodman, Daniel" <drodman-LjRBWs/[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <A4A1C995458F8B48B86E57568EF4AE8DB68009@mb-ls3.itorg.ad.buffalo.edu>
I'm working with python and oracle using the cx_Oracle module. I'm having issues getting fetchmany to iterate over my result set correctly. The table in the query, i2test, has over 20,000 rows, however the while loop hangs when it gets to about 1,800 rows. If I remove the order by clause... the loop hangs at about 12,000. Any advice?

cursor_metadata = cx_Oracle.Cursor(i_connection)

query_select = """SELECT name, code, cname, TO_CHAR(updatedate), TO_CHAR(downloaddate), TO_CHAR(importdate)
                                      FROM imetadata.i2test
                                      WHERE code like '%DIN%' AND
                                          cd = 'N'
                                      ORDER BY code"""

cursor_metadata.execute(query_select)

count = 0
results = cursor_metadata.fetchmany(100)
while results:
    print count
    count += 1
    results = cursor_metadata.fetchmany(100)

I realize this is probably something simple... thanks in advance.


Dan

------------------------------------------------------------------------------
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=157005751&iu=/4140/ostg.clktrk

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.