Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    1

    Unanswered: BD2 to MS SQL Double Byle Problem

    I know very little about DB2. But I am trying to figure out pull some data from a DB2 view into my MS SQL table. The problem is the DB2 table contains both English and Chinese characters. When I run my simple query, the English characters come through, but the Chinese show as question marks. I've tried changing Collation values, specifying codepages, but cannot find the right combination to get this working.

    I have the following SQL:

    SELECT vendornum, vendorname FROM OPENQUERY(OLE, 'select CAST(vendorname AS VARCHAR(30) CCSID 935) AS vendorname, vendornum from CHINA.SQLVIEWS.VENDORTEST')

    This is what I get:

    vendornum vendorname
    ---------- ------------------------------
    AA0011 ARBING INC
    AA0012 ???????(??)???
    AB0011 CARBONATE INC

    The parentheses are correct, but the question marks should be displaying chinese characters.

    As you can see from the SQL statement, the VENDOR field is 30 characters long (double byte from what I'm told) and using codepage 935.

    If I remove the cast and just reference the field as is, I get the following:

    vendornum vendorname
    ---------- ------------------------------
    AA0011 ARBING INC
    AA0012 ?y<0+O(?(s)!=(.
    AB0011 CARBONATE INC

    Similar, but not the same.

    I can query DBs on other MS SQL servers with Chinese characters and it displays just fine, so I know if it was correct, that I can see it.

    We've tried downloading 3rd party drivers, etc. and nothing seems to be working. I'm really hoping someone else has come across this problem and knows exactly what to do. Any help would be greatly appreciated.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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

Posting Permissions

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