Re: [cx-oracle-users] Bug/report cx_Oracle
Brought to you by:
atuining
From: Anthony T. <an...@co...> - 2003-07-07 14:20:26
|
If you are referring to this situation: import cx_Oracle connection = cx_Oracle.connect("user/pw@tns") cursor = connection.cursor() cursor.arraysize = 5 cursor.execute("select someblob from sometable") rows = cursor.fetchall() where the number of rows returned is greater than 5, then yes, you are correct. Unfortunately, that is the way that Oracle works. Internally a LOB locator is what is actually fetched but it is only valid as long as no additional fetches take place. The arraysize you specify defines the number of rows that are fetched in each internal fetch. If you ask for all of the rows, as many internal fetches will take place as needed and so the original LOB locators will be overwritten. A couple of other people have mentioned this problem to me as well so perhaps I ought to add some code to check for this situation and at least raise an error, eh? Any thoughts on that? In the meantime, your problem will disappear completely if you use the following method: while 1: row = cursor.fetchone() if row is None: break do_some_stuff() OR, if you are in Python 2.2 and running cx_Oracle 3.0 or greater for row in cursor: do_some_stuff() On Mon, 2003-07-07 at 08:07, Birgit Dreyer wrote: > Hello, > > if you select LOBs with an arraysize smaller than the resulted select > lists, your LOB Locators points to the LOBs of the first array. > > regards, > > Birgit > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... Computronix Distinctive Software. Real People. Suite 200, 10216 - 124 Street NW Edmonton, AB, Canada T5N 4A3 Phone: (780) 454-3700 Fax: (780) 454-3838 http://www.computronix.com |