Solved

Unicode to Ascii Oracle 10g

Posted on 2013-01-02
12
807 Views
Last Modified: 2013-01-02
I have a view created in Oracle 10g that outputs one field, which is returned Unicode.

My clients have old ODBC drivers that do not recognize Unicode.

How do I convert this field to ASCII ?
0
Comment
Question by:shelbyinfotech
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38737041
Depending on what unicode characters are in the data, it may not be possible.  For example, how would you convert a chinese character to simple ascii?

Can you provide some sample data and expected results?
0
 

Author Comment

by:shelbyinfotech
ID: 38737053
All the data will be ASCII
0
 
LVL 32

Expert Comment

by:awking00
ID: 38737196
What does your view code look like?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38737216
>>All the data will be ASCII

Then why can't you just select it?  an 'A' in a unicode database should be an 'A' when you select it out.

I agree with awking00, let's take a look at your view code.
0
 
LVL 15

Accepted Solution

by:
Franck Pachot earned 400 total points
ID: 38737289
Hi,
If the NLS_LANG is set (properly), the conversion should be automatic.
Regards,
Franck.
0
 

Author Comment

by:shelbyinfotech
ID: 38737310
Once selected in SQL Plus...yeah I get the data...I can't get it from the old odbc driver that msaccess is using
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38737319
Try setting NLS_LANG on the Client's client side as franckpachot suggested.
0
 

Author Comment

by:shelbyinfotech
ID: 38737345
Where would that be ? In the Oracle Client or ODBC ?
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 100 total points
ID: 38737352
It is an environment variable Oralce uses (registry in Windows):
http://docs.oracle.com/cd/E11882_01/server.112/e10729/ch3globenv.htm#NLSPG189
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38737634
I doubt this will solve the issue since the Unicode is likely coming from the default database characterset but wanted to throw it out there just in case it will trick the ODBC drivers.

The CONVERT sql function:
http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions034.htm#SQLRF00620
0
 

Author Closing Comment

by:shelbyinfotech
ID: 38737693
Thanks ....just had to find WHERE in the registry...btw it was in ORACLE_ALL_HOMES
0
 
LVL 15

Expert Comment

by:Franck Pachot
ID: 38737702
sqlplus and odbc should not use the same NLS_LANG as DOS and Windows codepage are different.
Are you sure that you have the right encoding in the database ? You should use DUMP function to check.
Maybe the data was entered with an incorrect setting.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

810 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