Try this. In gluon.sql.py (in trunk) after line 400 add

if fieldtype == 'text' and dbname ==
'oracle':
            return ":CLOB('%s')" % obj.replace('\'','\'\'')

On Sep 9, 4:31 pm, DJ <sebastianjaya...@gmail.com> wrote:
> Hi Massimo,
>
> Yes, you are correct. I used the "TEXT" datatype for an application I
> am building. While it works on MySQL, it throws errors on Oracle.
>
> Web2Py by default creates CLOB datatypes on Oracle when you specify
> TEXT in the model which causes this error. How did you fix this issue
> with BLOBs?
>
> I eventually had to do a work-around. I modified the Oracle datatype
> from CLOB to VARCHAR2 with a large character limit and changed the
> model definition from "text" to "string".
>
> -Sebastian
>
> On Sep 1, 8:42 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > OK. I know the problem. The fact is web2py does not create CLOBs so it
> > cannot handle them.
>
> > Actually this problem arises also with BLOBs and we fixed it long ago.
> > The same fix would apply to CLOBs too but there is no way for web2py
> > to know that a field is a CLOB since we do not provide a way to define
> > it.
>
> > I imagine you have a model that treats a legacy CLOB as text, correct?
>
> > On Sep 1, 12:20 pm,DJ<sebastianjaya...@gmail.com> wrote:
>
> > > Massimo,
>
> > > I am using -
>
> > > Python 2.5.2
> > > DB Driver: cx_Oracle-5.0.1-10g.win32-py2.5
> > > Oracle 10G
> > > Platform: Windows 2003 Server
>
> > > -Sebastian
>
> > > On Aug 29, 4:22 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > Which python version? I vaguely remember this had been addressed and
> > > > the problem has gone away.
>
> > > > Massimo
>
> > > > On Aug 28, 2:40 pm,DJ<sebastianjaya...@gmail.com> wrote:
>
> > > > > Hi,
>
> > > > > I get this error while retrieving CLOB data types from Oracle. This is
> > > > > also seen with the Web2Py admin interface when it tries to display all
> > > > > data rows. I am using the cx_oracle python database module.
>
> > > > > From their website,http://cx-oracle.sourceforge.net/html/lob.html
> > > > > Note: Internally, Oracle uses LOB locators which are allocated based
> > > > > on the cursor array size. Thus, it is important that the data in the
> > > > > LOB object be manipulated before another internal fetch takes place.
> > > > > The safest way to do this is to use the cursor as an iterator. In
> > > > > particular, do not use the fetchall() method. The exception “LOB
> > > > > variable no longer valid after subsequent fetch” will be raised if an
> > > > > attempt to access a LOB variable after a subsequent fetch is detected.
>
> > > > > It appears that Web2py DAL is using the fetchall method to retrieve
> > > > > the data. Kindly advise if you have any suggestions/ideas to fix this.
>
> > > > > Thanks,
> > > > > Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to