From 257501ce37675fb72dcbd362199d816cc343dfe1 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Fri, 24 Aug 2012 09:23:20 -0500 Subject: [PATCH] improved oparsing of CLOB in Oracle, thanks Daniel --- VERSION | 2 +- gluon/dal.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 97245b88..cca4a5d3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-24 09:15:19) dev +Version 2.00.0 (2012-08-24 09:23:07) dev diff --git a/gluon/dal.py b/gluon/dal.py index c6bc6e1d..62d1ca80 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -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):