Euro symbol and DB2 database codeset

16 May,2010 by Tom Collins

This problem of Euro symbol was diagnosed on this platform:

Red Hat Linux 4.6
DB2 V9.5.0.0
Database
 Database territory   = US
 Database code page   = 1208
 Database code set    = UTF-8


A developer outlined a problem where: When euro symbol was inserted - it converts as 3 characters . Therefore if a  varchar(50) column is defined , and a euro exists , it will attempt to store 52 characters .and throws a TRUNCATE error

The Problem was  confirmed via creating a test table in MYDB called "mytesttable".
Note: Database code set   = UTF-8

Executed an INSERT statement :

INSERT INTO mytesttable(ID,VALUES) VALUES (1,'€')

SELECT length(values) FROM mytesttable

Result = 3

I then created  a new database with different codeset :  and recreated the same table , running the same code
This time the database was set up with database code set   = 1252


I executed the same statement :
Executed an INSERT statement :

INSERT INTO mytesttable(ID,VALUES) VALUES (1,'€')


SELECT length(values) FROM mytesttable
Result = 1

 


 Read More

 DB2 Database code set - DBA DB2

Software unit testing and DB2 sql loop test code - DBA DB2

Author: Rambler(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on Euro symbol and DB2 database codeset

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright