Home > Database > Oracle > body text

How to solve the problem of garbled characters in Oracle query

藏色散人
Release: 2021-12-16 14:50:02
Original
10160 people have browsed it

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!