当前位置:网站首页>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 !
边栏推荐
- HJ prime factor
- Is it reliable to register and open an account for stock speculation? Is it safe?
- What is EC blower fan?
- Practice and exploration of vivo live broadcast application technology
- HJ21 简单密码
- 软件测试与质量期末复习
- HJ delete the character with the least number of occurrences in the string
- 云原生:云计算技术再次升级 开启全面云开发时代
- 打新债注册开户靠谱吗?安全吗?
- Installing redis on Linux
猜你喜欢
Construction and exploration of vivo database and storage platform
Mysql57 zip file installation
Section Xi. Axi of zynq_ Use of DMA
Recommended system series (Lecture 5): Optimization Practice of sorting model
腾讯下半年继续裁员,所有事业群至少缩减 10%,对此你怎么看?关注者
什么是EC鼓风机(ec blower fan)?
es6箭头函数中return的用法
Solving the longest palindrome substring by dynamic programming
Alibaba cloud server creates snapshots and rolls back disks
8 张图 | 剖析 Eureka 的首次同步注册表
随机推荐
Dbeaver 22.1.1 release, visual database management platform
在idea中,get和set方法爆红可能是没有安装Lombok插件
Code submission specification
R language ggmap
异或的应用。(提取出数字中最右侧的1,面试中经常用的到)
Section 5: zynq interrupt
open62541直接导入NodeSet文件
Open62541 import nodeset file directly
Is it reliable to register and open an account for stock speculation? Is it safe?
7-1 understand everything
HJ delete the character with the least number of occurrences in the string
Modifying MySQL user name root under Linux
Analyze 5 indicators of NFT project
Disposition Flex
Application and Optimization Practice of redis in vivo push platform
Hash slot of rediscluster cluster cluster implementation principle
HJ character count
Installing redis on Linux
Section 8: DMA of zynq
Section Xi. Axi of zynq_ Use of DMA