PL/SQL 别名时用中文字符报错ora-00911 或中文乱码解决办法
今天用PL/SQL 9(最新版)的绿色汉化破解版,发现在执行查询: select user_no 户号 from lack_charge 这个语句时在 user_no处报
今天用PL/SQL 9(最新版)的绿色汉化破解版,发现在执行查询: select user_no 户号 from lack_charge 这个语句时在 user_no处报错,错误为 ORA-00911: invalid character (无效的字符)。经过试验所有在别名中只要用中文字符就会报这个错。后来在网上查找原因结合实际情况发现:由于是绿色版,所以有些环境变量(或是注册表中的一些值)并没有正确设置造成的,解决办法是新建一个环境变量:
NLS_LANG,值是:AMERICAN.ZHS16GBK。
以下是更详细的说明:
这个可能是Oracle客户端和服务器端的编码方式不一样。
select * from v$nls_parameters t where t.PARAMETER ='NLS_LANGUAGE' or t.PARAMETER ='NLS_CHARACTERSET';
--数据库服务器字符集
select * from nls_database_parameters;
--客户端字符集 表示客户端的字符集的设置,可能是参数文件,环境变量或者是注册表
select * from nls_instance_parameters;
--会话字符集的设置,,这个没有特殊设置的话,和nls_instance_parameters一致
select * from nls_session_parameters;
--如果数据库服务器端的编码和客户端字符集编码不一样,则会导致乱码,因此需要更改客户端的编码方式。
--更改客户端的编码方式有两种方式,第一种是更改注册表,这个比较危险,就不在这里提及。第二种是设置环境变量。
--设置系统环境变量,新建一个环境变量:
NLS_LANG,值是:AMERICAN.ZHS16GBK。
--值的构成方式是数据库中查询的服务器端的“NLS_LANGUAGE的值”+“.”+“NLS_CHARACTERSET的值”

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)
