Solved

Unicode to Ascii Oracle 10g

Posted on 2013-01-02
12
814 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 77

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
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.

 
LVL 77

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 77

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 77

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 77

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

631 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