Solved

INSERTING UNICODE DATA IN SYBASE TABLE

Posted on 2004-10-27
1,231 Views
Last Modified: 2012-06-21
Hi,

I have created my Sybase Server on win 2k machine the codepage of the database is UTF8
what i want is to insert japnese utf 8 data in a tabel which i have created in Sybase
can anybody help me how to go about it
thanks in advance

Charandeep
0
Question by:charan_leo
    8 Comments
     
    LVL 24

    Expert Comment

    by:Joe_Woodhouse
    Hi, I've held off answering because I didn't quite understand your question, but I see after a couple of days no-one else has responded.

    What are you asking for help with? If you are using ASE 12.0+, you have configured the Sybase character set to utf8, and you have created the datatypes you want to put the data in as unichar (or possibly nchar/nvarchar), then you should be able to load the data as you would any other character data.

    ie. insert it as literal text
    bcp the data in from a file

    I'm not sure I've understood what the problem is...?
    0
     
    LVL 24

    Expert Comment

    by:Joe_Woodhouse
    The System Administration Guide has a chapter on internationalisation and code sets that might be helpful to you...

    http://sybooks.sybase.com/onlinebooks/group-as/asg1251e/sag

    Chapter 7.
    0
     

    Author Comment

    by:charan_leo
    Hi,

    Thanks for the help you have given
    i have installed adaptive server 12.5.2  on win 2k advanced server and now i have confugured my database server to UTF 8 as the charset of the database
    what i want is to do is insert unicode data in the nvarchar field in a table in sybase
    how do i do that?
    if i use isql then try and insert isql to input unicode data in a table with nvarchar field i am not able to do it

    plzz tell me how to go about it
    0
     
    LVL 24

    Expert Comment

    by:Joe_Woodhouse
    Can you show us exactly what it is you're doing, and what error messages you get when it fails?
    0
     

    Author Comment

    by:charan_leo
    i have created a tabel like this

    CREATE TABLE rware.dbo.cq_employee2 (

    emp_id                          int                                not null  ,

    name                            nvarchar(300)                      not null  ,

    comments                        nvarchar(300)                      not null  ,

    job_descr                       nvarchar(300)                      not null  ,

    index_flags                     int                                not null  
    )

    now i want to insert unicode data i.e data in japnese language in name comments and job_descr
    when i copy the unicode data and paste it in isql there r just ???? appear in place of the actual data
    i am not able to insert the actual unicode data
    there is no error as such but instead of actual data i get only ????? in place of unicode data in tabel as well

    can u tell me how to insert actual unicode data in it
    0
     
    LVL 24

    Expert Comment

    by:Joe_Woodhouse
    I'm wondering if that's an issue with the codepage of the isql or the command prompt session you are running isql in.

    Try adding

    -Jutf8

    to your isql command line. This will indicate the isql client itself is using utf8 as its codepage.

    We can confirm that the server character set is correct if you run

    sp_helpsort

    Check what it reports the default character set as. (You may have installed utf8 but not made it the default.)

    I'd also try creating a table and defining the columns as unichar rather than nvarchar:

    CREATE TABLE rware.dbo.cq_employee2 (
    emp_id                          int                                not null  ,
    name                            univarchar(300)             not null  ,
    comments                     univarchar(300)             not null  ,
    job_descr                      univarchar(300)             not null  ,
    index_flags                    int                                not null  
    )

    Try that both with and without -Jutf8 on the isql command line.

    Lastly, try using a GUI client like SQL Advantage that ships with the Sybase client you've installed on your server. This could just be an issue with isql, which doesn't really have a lot of capabilities...

    Good luck!
    0
     

    Author Comment

    by:charan_leo
    i have tried with -jutf8
    and also sp_helpsort it gives me the following output
    1> sp_helpsort
    2> go

     Collation Name                 Collation ID
     ------------------------------ ------------
     defaultml                                 0
     thaidict                                  1
     utf8bin                                   4
     altnoacc                                 39
     altdict                                  45
     altnocsp                                 46
     scandict                                 47
     scannocp                                 48
     binary                                   50
     dict                                     51
     nocase                                   52
     nocasep                                  53
     noaccent                                 54
     espdict                                  55
     espnocs                                  56
     espnoac                                  57
     rusnocs                                  59
     cyrnocs                                  64
     elldict                                  65
     hundict                                  69
     hunnoac                                  70
     hunnocs                                  71
     turknoac                                 73
     turknocs                                 74

     Loadable Sort Table Name
     ------------------------------

    Sort Order Description

     ------------------------------------------------------------------
     Character Set = 190, utf8
         Unicode 3.0.1 UTF-8 Character Set
         Class 2 Character Set
     Sort Order = 50, bin_utf8
         Binary sort order for the ISO 10646-1, UTF-8 multibyte encodin
         g character set (utf8).
    (return status = 0)
    1>

    the gui sql advantage which you have told me can you tell me the URL from where i can download the SQL advantage from
    i think you r right may be this is an issue with isql can u tell me the url of the GUI client which you arer talkin from where to download it
    SQL Advantage
    0
     
    LVL 24

    Accepted Solution

    by:
    sp_helpsort is showing the correct information, so your ASE is configured correctly.

    Try with the columns as uni(var)char rather than nvarchar.

    SQL Advantage is included with the Sybase ASE CDs. It's on the client CD.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT Security CISA, CISSP & CISM Certification

    Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle. Built around industry best-practice guidelines, the IT Cyber Security bundle consists of three in-depth courses.

    Suggested Solutions

    Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
    Know what services you can and cannot, should and should not combine on your server.
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    This video discusses moving either the default database or any database to a new volume.

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now