Handling special characters with Oracle OCI

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Soumyabrata
Participant
Posts: 8
Joined: Wed Nov 22, 2006 1:02 am
Location: India

Handling special characters with Oracle OCI

Post by Soumyabrata »

Hi,
I am trying to load data from a sequential file to a staging table in Datastage using ORacle OCI coneector.The file contains special characters.After load is done in the staging table,I am finding that the special characters have been replaced by junk characters in the table.I am using UTF8 as NLS and have also tries out MS1252 as NLS but without success.Can you pls. tell if DataStage supports Oracle OCI for special characters.If so how?If not so why,because logically OCI connector should not be a problem even if special characters are present in the data.

Thanks,
Soumyabrata
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

See if this post helps or any of the other posts you can find by searching for NLS_LANG.

If not, come back with more details, like what NLS_LANG setting your target database is and some examples of these 'special' characters. Some are more special than others, from what I recall.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Soumyabrata
Participant
Posts: 8
Joined: Wed Nov 22, 2006 1:02 am
Location: India

Post by Soumyabrata »

Hi,

We have tried inserting the data using OCI, by setting the load mode of OCI to manual which would create the above files.
In the control.ldr file add the parameter CHARACTERSET utf8.
Now log on to the unix session set NLS_LANG= AMERICAN_AMERICA.WE8ISO8859P1. If we run sqlldr the characters are loaded correctly.

sqlldr userid=<username>/<password> control=control.ldr

So it seems that the datastage is missing some NLS mapping. Please try to add the WE8ISO8859P1 NLS map in data stage, by default it is not present it might need to downloaded and installed.I am not sure about this, needs to be checked.Can some one help me how to download and install the NLS map?

Thanks,
Soumyabrata
Last edited by Soumyabrata on Fri Dec 22, 2006 4:08 am, edited 1 time in total.
Soumyabrata
Participant
Posts: 8
Joined: Wed Nov 22, 2006 1:02 am
Location: India

Post by Soumyabrata »

Hi,

We can try inserting the data using OCI, by setting the load mode of OCI to manual which would create the above files.
In the control.ldr file add the parameter CHARACTERSET utf8.
Now log on to the unix session set NLS_LANG= AMERICAN_AMERICA.WE8ISO8859P1. If we run sqlldr the characters are loaded correctly.

sqlldr userid=<username>/<password> control=control.ldr

So it seems that the datastage is missing some NLS mapping. Please try to add the WE8ISO8859P1 NLS map in data stage, by default it is not present it might need to downloaded and installed.I am not sure about this, needs to be checked.Can some one help me how to download and install the NLS map?

Thanks,
Soumyabrata
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you read the post I linked to? The blue letters there can be clicked on and will explain what you need to do. Short answer is modify your dsenv file.

DataStage isn't missing anything because it's not the one that needs that mapping - Oracle does. So nothing to download or install, just a little configuration change or two needed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dwuser
Premium Member
Premium Member
Posts: 13
Joined: Thu Apr 12, 2007 11:27 am
Location: Sunnyvale

Post by dwuser »

Chulett,

Can you please provide the link for this topic.
Bharathi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I did - as noted, it is in my first reply in this thread. And as noted, two words there should appear different - blue - they are the link to the topic in question.

Or simply search for NLS_LANG and you'll find a plethora of topics.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply