Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 819
  • Last Modified:

Unicode to Ascii Oracle 10g

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
shelbyinfotech
Asked:
shelbyinfotech
  • 5
  • 4
  • 2
  • +1
2 Solutions
 
slightwv (䄆 Netminder) Commented:
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
 
shelbyinfotechAuthor Commented:
All the data will be ASCII
0
 
awking00Commented:
What does your view code look like?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
slightwv (䄆 Netminder) Commented:
>>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
 
Franck PachotCommented:
Hi,
If the NLS_LANG is set (properly), the conversion should be automatic.
Regards,
Franck.
0
 
shelbyinfotechAuthor Commented:
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
 
slightwv (䄆 Netminder) Commented:
Try setting NLS_LANG on the Client's client side as franckpachot suggested.
0
 
shelbyinfotechAuthor Commented:
Where would that be ? In the Oracle Client or ODBC ?
0
 
slightwv (䄆 Netminder) Commented:
It is an environment variable Oralce uses (registry in Windows):
http://docs.oracle.com/cd/E11882_01/server.112/e10729/ch3globenv.htm#NLSPG189
0
 
slightwv (䄆 Netminder) Commented:
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
 
shelbyinfotechAuthor Commented:
Thanks ....just had to find WHERE in the registry...btw it was in ORACLE_ALL_HOMES
0
 
Franck PachotCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now