ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » problem:insert nchar to oracle in esql

Post new topic  Reply to topic
 problem:insert nchar to oracle in esql « View previous topic :: View next topic » 
Author Message
lcl3977
PostPosted: Sun Jul 09, 2006 11:19 pm    Post subject: problem:insert nchar to oracle in esql Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

in AIX 5.3 english language .
Our Oracle NLS_CHARACTERSET is utf-8,
in .profile we set NLS_LANG=american_america.al32utf8, LANG=en_US

then I write Chinese in esql,and then insert it into oracle.
but I can't find the right Chinese in the table.it only display ".....".
can somebody help me again.
thank you.
Back to top
View user's profile Send private message
jbanoop
PostPosted: Mon Jul 10, 2006 1:22 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

Hi,
I am not sure that character set on the DB is going to accept chinese.
We had a similar problem here with arabic data. We used a workaround for the same.
Check out the last entry on
http://www.mqseries.net/phpBB2/viewtopic.php?t=29799&highlight=arabic

Hope it helps,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
lcl3977
PostPosted: Mon Jul 10, 2006 1:42 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

thank you for your help.
our db support Chinese.
the problem of "arabic data",is read data from DB,
we can read it from DB ,and then convert it ,we can get correct char.
but I can't insert Chinese into DB.when I insert some words ,and then I export it in sqlplus,that just display "....."
Back to top
View user's profile Send private message
jbanoop
PostPosted: Mon Jul 10, 2006 2:58 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

let me explain the problem we faced:

We receive input which may contain arabic (read chinese) characters.
We insert the same into a DB (oracle)
We read the inserted data in another flow and send it on its way.

The issue we faced was at the second step where we try inserting into oracle , when the insert itself was resulting in some characters not being inserted. (My suspect is the oracle driver used by broker to talk to the DB ).

I think you are also facing the same problem. Do confirm my understanding.

So the work around we used was that we converted the arabic (read chinese) data to blob and inserted in blob field in DB. this prevents data loss during the insert.
In the code that is required to read it back from the DB, read it as blob and cast it to character. It will work fine.
Do let me know how you went with this (in case you try it)
Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Mon Jul 10, 2006 2:25 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Make sure you have set LANG, NLS_LANG, or other system specific environment variable in broker profile to proper language values for your system before trying to insert regional language characters into Oracle database.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Mon Jul 10, 2006 5:19 pm    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

thank you Anoop & jefflowrey.
Our environment is on AIX 5.3.
I test it in WINXP simple Chinese.
when I set DB charset GBK(that supports chinese),and then insert Chinese into DB in the esql, then I select it in sqlplus ,we can see the correct char.

But,when I test it in AIX,(the environment of AIX I has told),I can't see the correct char..
I think may be our environment variable has something wrong.I have changed them (e.g. NLS_LANG,LANG,LC_ALL).I don't know what I must set them.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 11, 2006 2:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The broker profile should have the AIX correct language environment variable - and I don't remember which is the AIX version - set to the most commonly used language you work with. So if most of your message data is Chinese, then set it to the chinese value. If most of it is English, then it would be "en_<cc>", where <cc> might be UK or US or etc.

But mostly the important thing is that it is actually set to *something*. Otherwise, national language characters tend to get mangled because they are translated improperly into the character set the DB is using.

And it's got to be in the broker profile - and you may need to restart the broker to ensure that it's set in the current execution.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Tue Jul 11, 2006 4:43 pm    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

thank you jefflowrey.
I had set LANG=zh_CN or LANG=zh_CN.UTF-8
and then I write Chinese in esql,insert into DB,It just display the same char(some incorrect words) in despite of what Chinese I write in esql.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 11, 2006 8:42 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

lcl3977 wrote:
thank you jefflowrey.
I had set LANG=zh_CN or LANG=zh_CN.UTF-8
and then I write Chinese in esql,insert into DB,It just display the same char(some incorrect words) in despite of what Chinese I write in esql.

Wouldn't chinese be a double byte character language and as such require either unicode or at least UTF-16 ??

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
lcl3977
PostPosted: Wed Jul 12, 2006 5:32 pm    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

fjb_saper wrote:
lcl3977 wrote:
thank you jefflowrey.
I had set LANG=zh_CN or LANG=zh_CN.UTF-8
and then I write Chinese in esql,insert into DB,It just display the same char(some incorrect words) in despite of what Chinese I write in esql.

Wouldn't chinese be a double byte character language and as such require either unicode or at least UTF-16 ??

Enjoy


Chinese is a double byte character language, and utf-8 can supports it.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Wed Jul 12, 2006 5:45 pm    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

when the broker is running on the winxp,and then insert chinese into remote database(on aix),we can also find the right char.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Thu Jul 13, 2006 1:12 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

successfully...
oh..yea....

when I set
Code:
export LANG=ZH_CN
export MQCCSID=1208

and then I insert chinese into db in esql. we find the right char displaying.
thank you for your help.

jbanoop
if you set the values the same sa me ,I think you won't convert them to blob.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Thu Jul 13, 2006 1:15 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

You can use the executable locale to show your current locale. The command locale -a displays all the locales currently installed on the machine. Make sure that the locale you select for LANG and LC_ALL is in the list that locale -a returns. The values that locale uses and returns are case-sensitive, so copy them exactly when assigning them to an environment variable.

When you start a broker component, the locale of that component is inherited from the shell in which it is started. The broker component uses the LC_MESSAGES environment variable as the search path in the NLSPATH environment variable (LC_MESSAGES is set when variable LC_ALL is exported).

Messages are sent to the syslog in the code page set by this locale. If you have multiple brokers that write to this syslog, their messages are in the code page of the locale in which they were started, for example:
Code:

locale syslog code page ccsid
pt_BR iso8859-1 819
Pt_BR ibm-850 850
PT_BR utf-8 1208
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » problem:insert nchar to oracle in esql
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.