All Forums Connectivity
yulian 1 post Joined 03/08
17 Mar 2008
Incorrect characters returned in UTF8 session

When using JDBC to retrieve characters from a char column in UTF8 charset session, we get a character string of double the size of the column length. Does anyone know why and how to workaound it?For example: 1. connect to the database in UTF8 sessionjdbc:teradata://td/CHARSET=UTF82. create table and insert dataCREATE TABLE employee (empName CHAR(10));INSERT INTO empolyee values('a');3. SELECT empName from employeeThe length of empName is 20. (Wrong!)4. connect to the database in default charset sessionjdbc:teradata://td5. SELECT empName from employeeThe length of empName is 10. (Correct!)I'm using JDBC Driver 12.0.0.1 and the database is V2R6.

tomnolan 594 posts Joined 01/08
05 Jul 2012

That is expected behavior due to the Teradata Database's Export Width feature. More information is available in the Teradata JDBC Driver Reference.

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_5.html#BGBJECGD

You must sign in to leave a comment.