PL/SQL alias with Chinese characters error ora-00911 or Chinese garbled Solution

Source: Internet
Author: User

Today with PL/SQL 9 (the latest version) of the green Chinese cracked version, found in the execution of the query: select user_no account from lack_charge statement in the user_no error reported, the error is ORA-00911: invalid character (invalid character ). This error is reported if Chinese characters are used in all aliases. Later, I found out on the internet that some environment variables (or some values in the Registry) were not correctly set due to the green version. The solution was to create an environment variable:

NLS_LANG; Value: AMERICAN. ZHS16GBK.

The following is a more detailed description:

This may be because the encoding method on the Oracle client and server is different.
Select * from v $ nls_parameters t where t. PARAMETER = 'nls _ language' or t. PARAMETER = 'nls _ CHARACTERSET ';

-- Database Server Character Set
Select * from nls_database_parameters;

-- The client Character Set indicates the setting of the client character set,It may be a parameter file, environment variable, or registry.
Select * from nls_instance_parameters;

-- Set the session character set. If there is no special setting, it is consistent with nls_instance_parameters.
Select * from nls_session_parameters;

-- If the encoding of the database server is different from that of the client Character Set, garbled characters may occur. Therefore, you need to change the encoding method of the client.
-- There are two ways to change the client encoding method. The first method is to change the registry, which is dangerous and is not mentioned here. The second is to set environment variables.
-- Set system environment variables and create an environment variable:
NLS_LANG; Value: AMERICAN. ZHS16GBK.
-- The value is composed of "NLS_LANGUAGE value" + "." + "NLS_CHARACTERSET value" on the server side of the database"

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.