DB2 database issue with Clob types

139 views
Skip to first unread message

Boris Aramis Aguilar Rodríguez

unread,
Apr 24, 2015, 12:17:53 PM4/24/15
to web...@googlegroups.com
<class pyodbc.Error'> ('ODBC data type -99 is not supported. Cannot read column LDTEXT.', 'HY000')

Hi, Im currently accesing a DB2 database (readonly) that is used by another application, my connection string is as follows:

db_tivoli = DAL('db2:pyodbc://driver=DB2;hostname=24.50.5.5;database=MAXDB71;uid=on_usr;pwd=pass.;port=50005', pool_size=1, db_codec='latin1', migrate=False)

and everything was going fine until I added a clobdata type to web2py data code

And now I'm getting the error I referenced above (sorry I couldnt paste it in order, Im on my phone) Any hints I would appreciate it :)

Paolo Valleri

unread,
Apr 25, 2015, 7:24:41 AM4/25/15
to web...@googlegroups.com
you should provide us more info...
which web2py type are you using that is mapped to CLOB field?
web2py/pyodbc version

Paolo

Boris Aramis Aguilar Rodríguez

unread,
May 4, 2015, 12:56:49 PM5/4/15
to web...@googlegroups.com
Hi, web2py data type is text; 

that it is the normal behavior of web2py, to map text-clob on IBM DB2 databases. 

Also on the same post they propose a solution editing db2cli.ini file but I don't know how to configure db2cli.ini (I mean, I know how to open it, where it is but I don't understand which alias should I put on the file)

Any help I will really appreciate it.

Thanks!

Boris Aramis Aguilar Rodríguez

unread,
May 4, 2015, 1:35:15 PM5/4/15
to web...@googlegroups.com
I've just fixed it :D

The thing is that those parameters (that fix up the issue with clob types and pyodbc) can be passed trough the web2py connection string, so it is now as follows:

db_tivoli = DAL('db2:pyodbc://driver=DB2;hostname=IP_OR_HOSTNAME;database=DATABASENAME;\
                uid=USER;pwd=PASSWORD;port=50005;LONGDATACOMPAT=1;LOBMAXCOLUMNSIZE=10485875',
                migrate=False, pool_size=0, attempts=1)

I'm so happy :)

Paolo Valleri

unread,
May 4, 2015, 1:37:35 PM5/4/15
to web...@googlegroups.com
well done

 Paolo

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/525AqDpOpio/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages