Home >Database >Oracle >How to solve the problem of garbled characters in Oracle query

How to solve the problem of garbled characters in Oracle query

藏色散人
藏色散人Original
2021-12-16 14:50:0210203browse

Oracle query garbled solution: 1. Check the server-side encoding; 2. Execute the statement "select * from V$NLS_PARAMETERS"; 3. Set the environment variable.

How to solve the problem of garbled characters in Oracle query

The operating environment of this article: Windows 7 system, Dell G3 computer, Oracle 11g version.

How to solve the oracle query garbled problem?

Oracle query Chinese garbled characters

is caused by the inconsistency between the encoding used by the PLSQL client and the server-side encoding.

1. Check the server-side encoding

Select userenv('language') from dual;

The actual result I found is: AMERICAN_AMERICA.UTF8 (everyone may find it differently)

2. Execute the statement select * from V$NLS_PARAMETERS

Check whether the VALUE item corresponding to NLS_LANGUAGE in the PARAMETER item in the first row is the same as the value obtained in the first step.

If not, environment variables need to be set.

3. Set environment variables

Computer-->Properties--> Advanced system settings--> Environment variables-->System environment variables-->New

Set variable name: NLS_LANG

Variable value: The value found in the first step, AMERICAN_AMERICA.UTF8 (subject to the one you found in the first step)

Related recommendations: oracle database learning tutorial

The above is the detailed content of How to solve the problem of garbled characters in Oracle query. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn