当前位置:网站首页>How to insert a single quotation mark into a table as a data type in Oracle pl/sql
How to insert a single quotation mark into a table as a data type in Oracle pl/sql
2022-06-28 07:44:00 【Zeiyalo】
Oracle PL/SQL How to insert a single quotation mark as a data type into a table
According to the information I checked , stay MySQL In the basic query of , Single quotation marks (’) With double quotes (”) The use requirements of are not so strict , But in Oracle PL/SQL in , The use requirements of single quotation marks and double quotation marks are different , The string type in the field uses single quotation marks , Such as :INSERT INTO TABLE VALUES ('Zeiyalo');
The query result of the above statement in the table is Zeiyalo;
Then you can also nest the double quotation marks inside the single quotation marks and enter them into the middle of the table as string data , Such as :INSERT INTO TABLE VALUES (' "Zeiyalo" ');
The query result of the above statement in the table is "Zeiyalo";
No error will be reported in the above two cases , But when you nest single quotes inside single quotes , You're going to report a mistake , This is because in the PL/SQL The middle single quotation mark obeys the principle of proximity , The next single quotation mark after the first single quotation mark is the end mark of a string , Is there any way to add a single quotation mark to the table ?
After inquiring about the information , I learned that in the following SQL In learning, single quotation marks can be used as escape characters , This is the second single quotation mark except for the end sign , You can also escape the next special character . But the data is only used in the program block , Not used in simple query statements , I tried it in a simple query and found that it could be used ;
( The above information comes from the link :Oracle Use and escape of single quotation marks )
So when we wanted to SQL When a single quotation mark is inserted as data in the table , The following methods can be adopted :INSERT INTO TABLE VALUES ( ' Zeiyalo''s birthday ' );
The results shown in the above table are Zeiyalo's birthday;
OK, Problem solving !
边栏推荐
- ACM笔记
- Is it reliable to register and open an account for stock speculation? Is it safe?
- Evaluation of inverse Polish expression < difficulty coefficient >
- HTTP Caching Protocol practice
- HJ delete the character with the least number of occurrences in the string
- Drawing animated bubble chart with R language
- ZYNQ_ IIC read / write m24m01 record board status
- pip 更新到最新的版本
- 云原生(待更新)
- flutter 实现摇一摇功能
猜你喜欢

什么是EC鼓风机(ec blower fan)?

扩展Prometheus的解决方案thanos的简介和几个月使用心得

2021 programming language ranking summary

Construction and exploration of vivo database and storage platform

云原生(待更新)

Redis one master multi slave cluster setup

asp. Net error "/" server error in the application. String or binary data would be truncated. The statement...

ACM笔记

Uninstall and reinstall the latest version of MySQL database. The test is valid

Alibaba cloud server creates snapshots and rolls back disks
随机推荐
剑指Offer||:链表(简单)
代码提交规范
ACM笔记
linux下修改mysql端口号
kubernetes删除pod的流程的源码简析
Introduction and several months' experience of extending the solution thanos of Prometheus
HJ explicit random number
Application of XOR. (extract the rightmost 1 in the number, which is often used in interviews)
Localization SoC development plan
Practice of traffic recording and playback in vivo
kubelet驱逐机制的源码分析
Porting ucosiii to stm32f429
kubelet垃圾(退出的容器和未使用的镜像)回收源码分析
ABAP skill tree
asp. Net error "/" server error in the application. String or binary data would be truncated. The statement...
Online WPS tool
Design and implementation of spark offline development framework
分析 NFT 项目的 5 个指标
数字藏品市场“三大套路”
推荐系统系列精讲(第五讲): 排序模型的调优实践