Oracle 11g and .NET ODP character set conversion - oracle

We have Oracle 11g database with EE8ISO8859P2 character set. This character set can’t be changed, i.e. it must stay as it is.
However the data that will be inserted and read from the database will be from another character set: CL8MSWIN1251.
We are using .NET and ODP. One possible approach is manual transliteration in the .NET application itself.
Is the following scenario with Oracle 11g, .NET and ODP feasible?
Data is stored on the server into database with EE8ISO8859P2 character set encoding.
ADO.NET ODP driver connects to the database and retrieves the character data as opaque bytes which are further decoded in the .NET client by using the mapping: CL8MSWIN1251=>CLR Unicode.
We have tried with NLS_LANG environment variable but that did not solve the problem.
Any suggestions?

I assume you mean ODP instead of ODC.
I don't think your proposal is a good idea. Of course, it is always possible to "cheat" the database character inside your .NET application. But imagine a DBA has to analyze an issue on the database. Usually he will use a tool like SQL*Plus, SQL Developer, or similar. Or what happens when another tool access the database, e.g. for reporting purpose. All these topics will not work.
An Oracle database actually has two character sets, the "normal" one the the "national" one. Perhaps you can use the second characters set by using NVARCHAR or NCHAR datatypes.

Related

migrating database from access 2003 to oracle Arabic characters are shown as question marks

UPDATE
as answer below shows that is error couse by JDBC so is there any
other suggestion to migrate access database to oracle database other
than using toad and the hard way to do it because trigger views
sequences wont be imported by that way so I have to create them by my
self??! :S
I am migrating database from access 2003 to oracle database 12c but Arabic characters are shown as question marks at the step where you connect to access database using SQL developers
I followed what you suggest at this answer and restart my pc but nothing changed
NOTE
when opening .mdb file from access Arabic characters shown right but when opening it from SQL developers I get question marks instead of arabic characters
is there anything else to do ?
I run that query as #krokodilko suggested and I get below result
select * from nls_database_parameters where parameter like '%CHAR%'
NLS_NCHAR_CONV_EXCP FALSE
NLS_NUMERIC_CHARACTERS .,
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_CHARACTERSET AR8MSWIN1256
select * from nls_session_parameters where parameter like '%LANG%';
NLS_LANGUAGE ENGLISH
NLS_DATE_LANGUAGE ENGLISH
by the way when I open another Oracle schema Arabic characters show correctly dose access has special encoding ?
Unfortunately, this looks like a problem with JDBC-ODBC Bridge. It does not work properly with the Access ODBC driver when text includes Unicode characters.
See other questions regarding MS Access over JDBC-ODBC Bridge like this:
Reading Unicode characters from an Access database via JDBC-ODBC.
There is also proposed solution which may work for general Java-to-MSAccess connection using pure Java JDBC driver (UCanAccess):
Manipulating an Access database from Java without ODBC
But, your question is about using SQL Developer for migration, so, it is not a solution for you, since SQL Developer supports only limited number of JDBC drivers. Not UCanAccess.
Hard-way is better than no-way.

SSIS 2008 R2 - Convert Oracle Character set data (with french accent)

I'm trying to extract data out of an Oracle database that is configured with the following:
NLS_CHARACTERSET EE8ISO8859P2
NLS_NCHAR_CHARACTERSET AL16UTF16
I'm working with SSIS 2008 R2 Standard (had to install Oracle 11g Client). Some accent are properly interpreted (e.g: é) but some are received as weird character and I can't find any way to convert them properly :( The Oracle database is used by our ERP that serves many countries around the world which probably explains the character set choice (I'm not debating if it's a good one or not, I'm a SQL Server guy, not Oracle).
I've tried different approach to extract the data from Oracle, none of which succeeded. I thought I could simply use something as:
SELECT CONVERT(FIELDNAME,'UTF8','EE8ISO8859P2') FROM xxx
Without success.. In my ERP I can see the following value:
"modèle" which is read "modcle" with the previous query through SSIS.
I kinda feel that there's no way I'm gonna get the proper data unless there's some magic formula that can be used. Any help would be appreciated.
Thank you.
All you need to do is set your NLS parameters using some ALTER SESSION commands.
Guess the parameter you need to change would be NLS_LANG
See this page for more information:
http://docs.oracle.com/cd/A87860_01/doc/server.817/a76966/ch2.htm
Strangely, I helped one of my teammates today to sort in Swedish using this. Hope it helps you too.

Oracle encoding problems

There is aan Oracle database with regional encoding for Kazakh language. There is also a client, but it uses UTF encoding.
When i update db field in Kazakh through pl/sql developer or call update proc in web application, these special characters becomes '?'.
But if i locate ora18n java file in oracle sql developer folder and update field in Kazakh, everithing works well.
How can solve my problem? If you need any db or clinet conf, u are welcome!

problems in inserting spanish words in oracle db

Is there a way to insert spanish words into the Oracle table - like 'España'.
When I try to insert it, it either takes the ASCII counterpart of it or replaces the 'ñ' with a '?'.
Has anyone done this before or knows a work around for it?
I found something while googling they told we have to mention spanish character set in init.ora file. I don't know how to do this and also setting nls_settings for client. I am using toad to connect to server which is located in UK.
Please help me in solving this problem.
First, you should check if the database was created with a character set that includes the Spanish characters that you want inserted. For versions of Oracle starting with 9i the wizards by default create the database using Unicode, so it shouldn't be a problem. But if the database wasn't created by you, this should be the first thing to check with the DBA that created it.
Which version of the Oracle server are you connecting to?
Which version of the Oracle client are you using? Which kind of Oracle client (OCI, JDBC, .NET)?
If the database was properly created it can be a problem related to the client platform.
And this is not simple to diagnose without information about the client OS, database client libraries that you are using and their configurations related to Natural Language Support.
So, I will point you to an Oracle FAQ related to this issue. It is a lot of material to read but it worths your time.
http://www.oracle.com/technetwork/database/globalization/nls-lang-099431.html

how to use different oracle character sets in one application

i'm developing a 32bit Client-Application with Delphi. From this application I need to connect to databases on two different servers. First databse character set ist WE8MSWIN1252, the other server decodes with WE8PC850. Setting the client NLS_LANG parameter to the correct value solves correct sql-query results.
Unfortunately this (the client character-set) seems only to be recognized on applications startup (first connect to oracle). I need to change the client-characterset at runtime. Oracle client seems to store the character set an application used to connect!
beside: I#m using udl-files to setup the connections (Microsoft OLE DB - driver)
what can I do?
You could use ALTER SESSION calls to change the settings at the session level after connecting to the database.
I need to change the
client-characterset at runtime.
Why ? I would have thought what you want at the client end is a character set that is acceptable to the operating environment and end-user.
Pick out a character set such as UTF-8 and let Oracle handle the conversion between the client character set and the two database character sets.

Resources