PL/SQL sets the encoding method, and plsql sets the Encoding

Source: Internet
Author: User

PL/SQL sets the encoding method, and plsql sets the Encoding
(21:38:33)Reprinted token

Tags: Miscellaneous Category: ORACLE

Garbled characters occur when exporting SQL files. Baidu later found that the problem was caused by inconsistent character encoding settings between the PL/SQL client and ORACLE. (There was a prompt when I logged on to PLSQL/Developer, but I didn't care about it). The online information is as follows:

When you log on to PLSQL/Developer, the system prompts that the character encoding settings on the client and server are inconsistent.
Some methods for setting and querying the oralce character encoding are recorded as follows:

1. Composition of the NLS_LANG Parameter
The NLS_LANG parameter consists of the following parts:
NLS_LANG = _.

The meanings of NLS_LANG are as follows:
LANGUAGE:-the LANGUAGE in which Oracle messages are sent.-The month in the date and the day are displayed.
TERRITORY specifies-currency and number format;-region and week and date calculation habits
CHARACTERSET:-controls the character set used by client applications. It is usually set to or equal to the client (such as Windows) code page, or UTF8 for unicode applications.

 

Select * from v $ nls_parameters;

 

LANG = zh_CN.GBK

NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

In the window, you can also modify my PC-> properties-> advanced-> environment variables-> NLS_LANG to directly modify and restart pl/SQL.

 

 

AMERICAN_AMERICA.WE8ISO8859P1 of iso8859

SIMPLIFIED CHINESE_CHINA.ZHS16GBK of gbk

 

 

My solution is to open the runner and go to the Registry for editing.
Run --> regedit (Registry)
--> Value of NLS_LANG in HKEY_LOCAL_MACHINE \ SOFTWARE \ ORACLE \ KEY_OraDb11g_home1
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
Change to the following values:
SIMPLIFIED CHINESE_CHINA.AL32UTF8 (server-side encoding --- ORACLE encoding)

Then restart pl/SQL developer

Select userenv ('language') from dual; -- query the encoding method of ORACLE

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.