Solved

Unicode to Ascii Oracle 10g

Posted on 2013-01-02
12
805 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
 
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now