improved oparsing of CLOB in Oracle, thanks Daniel

This commit is contained in:
Massimo Di Pierro
2012-08-24 09:23:20 -05:00
parent eb802838ee
commit 257501ce37
2 changed files with 9 additions and 1 deletions

View File

@@ -1 +1 @@
Version 2.00.0 (2012-08-24 09:15:19) dev
Version 2.00.0 (2012-08-24 09:23:07) dev

View File

@@ -2735,6 +2735,14 @@ class OracleAdapter(BaseAdapter):
self.execute('SELECT %s.currval FROM dual;' % sequence_name)
return int(self.cursor.fetchone()[0])
def parse_value(self, value, field_type, blob_decode=True):
if blob_decode and isinstance(value, cx_Oracle.LOB):
try:
value = value.read()
except cx_Oracle.ProgrammingError:
# After a subsequent fetch the LOB value is not valid anymore
pass
return BaseAdapter.parse_value(self, value, field_type, blob_decode)
class MSSQLAdapter(BaseAdapter):