chornbeak / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Oracle returns ORA-01406(fetched column value was truncated) #349

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I run "d = pyodbc.connect("DSN=****;PWD=****")"
2.next, run "cur = d.execute("select ***, ***, ***, ... from [table name]")
-> [table name] has 28 columns(3 primary key, one of columns is varchar(120) 
for multibyte character(Japanese, etc))
3.next, run "cur.fetchone()"

What is the expected output? What do you see instead?
In above 3., I looked following error.
"Then happens error: Error: ('HY000', '[HY000] [Oracle][ODBC][Ora]ORA-01406: 
fetched column value was truncated\n (1406)(SQLFetch)')"

What version of the product are you using? On what operating system?
Python 2.7.5 + pyodbc-3.0.7.win32-py2.7.exe
Database: Oracle 9i

Please provide any additional information below.
  By the way, I test and confirmed same code in other python program "cx_Oracle".
That program do not has an error.
  Perhaps, I think that output way of multibyte(not unicode?) of pyodbc is different from the cx_oracle.
 cx_oracle: u'\uff30\uff33\uff30\uff30\uff0c\uff21\uff14\uff0c"
 pyodbc   :  '\xef\xbc\xb0\xef\xbc\xb3\xef\xbc\xb0\xef\xbc\xb0\xef\xbc\x8c\xef\xbc\xa1\xef\xbc\x94'
(In other words, length of output character is different?)

Original issue reported on code.google.com by lumid...@gmail.com on 4 Dec 2013 at 6:36