PLSQL inserts garbled Chinese characters, plsql inserts garbled data
I recently bought a notebook and re-installed oracle. I used PLSQL. After installation, I tried it and inserted the Chinese SQL value with garbled characters.
Chinese garbled characters are caused by inconsistent encoding. The solution is to unify the encoding.
In this case, the encoding of the client and the server is inconsistent. 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.