当前位置:网站首页>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 !
边栏推荐
- Section VII starting principle and configuration of zynq
- R language Kolmogorov Smirnov tests whether the two samples follow the same distribution.
- SOC timer and interrupt configuration
- Unity-UI-shadow组件
- HJ字符串排序
- Co process, asyncio, asynchronous programming
- 一个小工具可以更快的写爬虫
- Rediscluster cluster mode capacity expansion node
- Can okcc call centers work without computers?
- HJ进制转换
猜你喜欢

In idea, the get and set methods may be popular because the Lombok plug-in is not installed

Solving the longest palindrome substring by dynamic programming

Construction and exploration of vivo database and storage platform

asp. Net registration page

Leetcode learning records

linux下修改mysql端口号

HTTP Caching Protocol practice

Static resource compression reduces bandwidth pressure and increases access speed

在idea中,get和set方法爆红可能是没有安装Lombok插件

ACM笔记
随机推荐
HJ delete the character with the least number of occurrences in the string
What is EC blower fan?
HJ进制转换
Practice and exploration of vivo live broadcast application technology
Section 8: DMA of zynq
Is it safe to open an account on Dongfang fortune
8 figures | analyze Eureka's first synchronization registry
Application of XOR. (extract the rightmost 1 in the number, which is often used in interviews)
Cloud native (to be updated)
打新债注册开户靠谱吗?安全吗?
Co process, asyncio, asynchronous programming
基金的投资交易与结算
Hj21 simple password
Kubernetes cluster command line tool kubectl
golang gin框架进行分块传输
Block transmission by golang gin framework
Porting ucosiii to stm32f429
Investment transaction and settlement of the fund
Software design of power control board
goland IDE和delve调试位于kubernetes集群中的go程序