PLSQL inserts garbled Chinese characters

Source: Internet
Author: User
Tags character set import database


The biggest possible cause of this situation is the inconsistency between the client and the server. Encoding is always a problem that troubles non-English countries. The solution is as follows:
1.
View server code
Select userenv ('language') from dual;
The actual result I found is: AMERICAN_AMERICA.AL32UTF8
2.
Execute the statement select * from V $ NLS_PARAMETERS
Check whether the VALUE corresponding to NLS_LANGUAGE in PARAMETER in the first line is the same as the VALUE obtained in the first step.
If not, you need to set the environment variable.
Otherwise, the PLSQL client uses inconsistent encoding with the server encoding, and garbled characters will appear when Chinese characters are inserted.
3.
Set environment variables
Computer> Properties> Advanced System Settings> environment variables> New
Set the variable name: NLS_LANG, and the variable value: the value found in step 1 (my name is AMERICAN_AMERICA.AL32UTF8 ).
4.
Restart PLSQL and insert data normally.

Supplement: PL/SQL imports data to another database with garbled characters


Import database: SIMPLIFIED CHINESE_CHINA.ZHS16GBK;

Export database: AMERICAN_AMERICA.AL32UTF8

To solve this problem easily, we modified the language and character set used to import the database.

Open the Run dialog box and run the "regedit" command to enter the registry. Find HKEY_LOCAL_MACHINE/SOFTWARE under my computer.

/ORACLE/KEY_OraDb10g_home1 (this path is the configuration information of oracle in the registry ),

Check that the value of the name NLS_LANG is SIMPLIFIED CHINESE_CHINA.ZHS16GBK and change it to AMERICAN_AMERICA.AL32UTF8,

Then re-enter PL/SQL to import data again. It should be normal.

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.