[cx-oracle-users] ValueError: string data too large
Brought to you by:
atuining
From: Mark H. <mh...@pi...> - 2010-07-07 20:43:34
|
A coworker has asked me this... he's occasionally geting a "ValueError: string data too large" when calling cursor.execute(). we're going to try something like this: clob = cursor.var(cx_Oracle.CLOB) clob.setvalue(0, contents) and see if that works. But I'm a bit confused, since the code below works the majority of the time. 1. are we on the right track to change to use clob.setvalue? 2. should the simple string code work at all? Many TIA!!! Mark ---------------------------- Mark, This is the "ValueError: string data too large" error message that I brought up in our last meeting. It only happens sometimes, but causes grief when it does. In this instance the value for the CLOB column called "contents" in our foo table is around 130,000 characters. There are other rows in that table with longer values up to 179507, so clearly the limit (if there is a limit at all) is not being exceeded. This one happened a little before 3:29 today. Could you ask the DBAs to look into this? 370 contents = simplejson.dumps(newworkspace).encode('ascii') 371 sql = "UPDATE foo SET name=:1, owner=:2, viewers=:3, contents=:4 WHERE workspaceid=:5" 372 values = [name, owner, viewers, contents, workspaceid] 373 self._cursor.execute(sql, values) > File "/data/foo.py", line 373, in saveWorkspace > self._cursor.execute(sql, values) > > ValueError: string data too large |