Troubleshooting of garbled characters in Oracle 8i update related types

Source: Internet
Author: User

When Oracle 8i updates related records of the varchar2 and date types, varchar2 may encounter garbled characters. Although Oracle 8i was used before, it is not currently used by the majority of users, however, some people are still using it, such as introducing Garbled text and other related issues.

Problem description:

Environment: windows XP, Oracle 8i 8.1.6.0.0

Problem: When you use JDBC to connect to a database and update a record containing the varchar2 and date types at the same time, a varchar2 may contain garbled characters, whether in English or Chinese, it is also possible that the first half of the same field is garbled and the second half is not garbled. The same SQL statement can be executed using sqlplus.

Solution:

First, run the following statement with the DBA permission:

Select tab1.aa | '_' | tab2.bb | '. '| tab3.cc from (select VALUE $ aa from sys. props $ where name = 'nls _ LANGUAGE ') tab1, (select VALUE $ bb from sys. props $ where name = 'nls _ ISO_CURRENCY ') tab2, (select VALUE $ cc from sys. props $ where name = 'nls _ CHARACTERSET ') tab3

In the Oracle 8i running, update and copy the execution results of the preceding statement. The execution result on my machine is: AMERICAN_AMERICA.ZHS16GBK open the registry, locate HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOME0, and find NLS_LANG, double-click to change the value to the one you just copied.

After modifying the registry, restart the machine. There may be some problems here. First, if your ORACLE is not successfully installed, you may have HOME0, HOME1, etc. In my experience, I first changed the NLS_LANG in HOME1, but the problem persists, and the problem is solved only after HOME0 is changed. So when the problem is changed, change all the NLS_LANG in HOMEX. If not, create a new one.

Second, a single change to the registry may also cause problems. At this time, we need to change the jdbc driver. Do not use the drivers that are 10 Gbit/s, 9i, and 8i, and find them in the jdbc directory in the oracle installation directory, use the driver here to solve the problem.
 

The above is an introduction to the varchar2 garbled content when Oracle 8i updates a record of the varchar2 and date types.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.