I hope my today's activity with Oracle testing helps to improve
web2py!

Model:

db.define_table('settings',
    SQLField('created_at', 'datetime', default=datetime.datetime.now
()),
    SQLField('meta', 'text'),
)

Controller action:

outp = 'Long text longer than 4000 symbols'
db.settings.insert(meta=outp)

gives error
ORA-01704: string literal too long

I found a workaround but it should be in gluon eventualy:

if db._dbname == 'oracle':
            cursor = db._connection.cursor()
            #cursor.setinputsizes(value = cx_Oracle.CLOB)
            cursor.execute("insert into settings(meta) values
(:value)", value = outp)
else:
            db.settings.insert(meta=outp)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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