Oracle 特殊符号''的处理
在SQL*Plus中默认的quot;quot;表示替代变量,也就是说,只要在命令中出现该符号,SQL*Plus就会要你输入替代值。这就意味着你无
在SQL*Plus中默认的"&"表示替代变量,也就是说,只要在命令中出现该符号,SQL*Plus就会要你输入替代值。这就意味着你无法将一个含有该符号的字符串输入数据库或赋给变量,如字符串“SQL&Plus”系统会理解为以“SQL”打头的字符串,它会提示你输入替代变量Plus的值,如果你输入ABC,则最终字符串转化为“SQLABC”。
方法一:set define off
set define off 则关闭该功能,"&"将作为普通字符,如上例,,最终字符就为“SQL&Plus”
set define off关闭替代变量功能
set define on 开启替代变量功能
set define * 将默认替代变量标志符该为"*"(也可以设为其它字符)
方法二:在SQL语句中将'&'替换成chr(38),因为chr(38)是'&'的ASCII码
SQL> Select 'Tom' || chr(38) || 'Jerry' from dual;
方法三:分拆原来的字符串
SQL> Select 'Tom' || '&' || 'Jerry' from dual;

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.

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

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 securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)
