[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-db-sig
Subject:    [DB-SIG] cx_Oracle CLOB.read() fails with cursor.fetchmany()
From:       sorr () rightnow ! com (Orr, Steve)
Date:       2004-05-13 19:53:24
Message-ID: D30BE1A2F9109A43BA989E2F51684056062CA31C () pobox ! corp ! rightnow ! com
[Download RAW message or body]

When I do a fetchmany (or fetchall) on a table where some of the CLOB
columns are empty it doesn't get CLOB data on non-empty CLOBs. Example:
----------------------------------------------
osql = 'select clobcol from clobtable'
ocurs.execute(osql)
rows = ocurs.fetchmany(10000)
for row in rows:
    try:print "CLOB value:\n%s\n"%row[0].read()
    except: print "CLOB value:\n%s\n"%'None'
----------------------------------------------

However if I just fetch one row at a time it works properly. Example:
----------------------------------------------
ocurs.execute(osql)
row = ocurs.fetchone()
while row:
    try:print "CLOB value:\n%s\n"%row[0].read()
    except: print "CLOB value:\n%s\n"%'None'
    try:row=ocurs.next()
    except StopIteration:break
----------------------------------------------

Is this a bug? Is there a good way to use CLOB.read() in conjuction with
fetchmany? Enhancement request if not. :-)


Steve Orr

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic