Help with DCOracle2 and CLOB data reads
Hello all, I have a database with a CLOB data column that I'm trying to read data from. I am using DCOracle2, and the howto found here: http://www.zope.org/Members/peterb/oracle_lobs Also, I have found the DCOracle2 Users' guide here: http://iteso.mx/~jose/DCOracle2.pdf Neither of these are helping me, though. I downloaded the example zexp file from the first link above. After customizing the column names for my database, I get a page that shows the following information: CORPORATE_ID MOLFORMULA (the clob field) 'CID-0000926' None I can't figure out why the blob isn't showing up. I edited the example scripts again to include a LOBLENGTH field in the HTML results, and I get something similar to this: CORPORATE_ID LOBLENGTH MOLFORMULA 'CID-0000926' 10 None Therefore, I AM getting some data in the loblocator. I just can't figure out how to get it to text. I even tried the following: for row in container.sql_select_blob(corporate_id=id): lob = row['molformula'] #I also tried numerical row indexes #here (row[1]) but that didn't help either length = lob.length() formula = lob.read(length) formula2 = str(formula) #THIS I ADDED TO TRY TO FORCE IT TO A STRING, # ALSO I TRIED repr() BUT IT DIDN'T HELP EITHER result.append({'corporate_id': row['corporate_id'], 'length': length,'molformula': formula2}) I added the comments to the code above (I know it breaks the indent rules...it wasn't there when I ran the code). If I query the table via SQLPlus to see if any of the clob fields are null (select ID from test where clob is null) I get 2 IDs (out of 811 records). Therefore, I have made sure I'm not querying those clobs for the time being. Any help here would be greatly appreciated. Thanks, Dave
David Thibault wrote:
Hello all,
I have a database with a CLOB data column that I'm trying to read data from. I am using DCOracle2, and the howto found here: http://www.zope.org/Members/peterb/oracle_lobs
The binary builds of DCOracle2 1.2 are b0rked. Grab the CVS source and build it; eventually I'll cut another binary build but it's a total nuisance to go build binaries for all the platforms multiplied by the varieties of Python, so I dont do it very often.
participants (2)
-
David Thibault -
Matthew T. Kromer