Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: How to insert Russian Cyrillic characters in DB2 database

    Hi,
    using DB2 v10.1 fixpack 1 on Linux I got requirement to create a database with data in tables in western characters (latin) AND Russian Cyrillic.

    I created UTF-8 database, created simple table:
    Code:
    db2 "create database utf8 using codeset UTF-8 territory us"
    db2 connect to utf8
    db2 "create table admin.test (col1 char(20))"
    Then from web page https://en.wikipedia.org/wiki/Cyrillic_script#Letters copied second character from "The early Cyrillic alphabet" list and created insert and select to see what is inserted.

    Code:
    C:\aaa>db2 "insert into admin.test values ('Б')"
    DB20000I  The SQL command completed successfully.
    
    C:\aaa>db2 select * from admin.test
    
    COL1
    --------------------
    ?
    The problem is in "select" I get question mark character instead of cyrillic.
    Any idea why? How to insert Russian Cyrillic characters in DB2 database?

    P.S. I choose UTF-8 code page, because I can expect to get any other request from customer selling products all over the world. So it is quite a big chance I will be force to store other (beside latin and cyrillic) characters.
    Thanks
    Last edited by grofaty; 04-18-13 at 03:28.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    you need a russian client to display these characters
    there is a doc about japanese characters - should be similar for you
    Setting Up a Mixed-Byte Character Set (MBCS) Database on an English OS in DB2 UDB Version 8
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    The table data will be OK; the "?" is the default character shown when the client uses a code page which cannot represent the database character (your 'Б').

    Your client application (db2 command line command) most likely uses code page 1252 (Windows) by default; make sure this becomes 1208 (UTF-8):

    db2set DB2CODEPAGE=1208

    If that doesn't help, try using a graphical SQL client, e.g. Data Studio.

    -- Peter.

    Quote Originally Posted by grofaty View Post
    Using DB2 v10.1 fixpack 1 on Linux I got requirement to create a database with data in tables in western characters (latin) AND Russian Cyrillic.

    I created UTF-8 database, created simple table:
    Code:
    db2 "create database utf8 using codeset UTF-8 territory us"
    db2 connect to utf8
    db2 "create table admin.test (col1 char(20))"
    Then from web page https://en.wikipedia.org/wiki/Cyrillic_script#Letters copied second character from "The early Cyrillic alphabet" list and created insert and select to see what is inserted.

    Code:
    C:\aaa>db2 "insert into admin.test values ('Б')"
    DB20000I  The SQL command completed successfully.
    
    C:\aaa>db2 select * from admin.test
    
    COL1
    --------------------
    ?
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •