• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1559
  • Last Modified:

INSERTING UNICODE DATA IN SYBASE TABLE

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
charan_leo
Asked:
charan_leo
  • 5
  • 3
1 Solution
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
charan_leoAuthor Commented:
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Joe WoodhousePrincipal ConsultantCommented:
Can you show us exactly what it is you're doing, and what error messages you get when it fails?
0
 
charan_leoAuthor Commented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
charan_leoAuthor Commented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now