Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Data is inserted with special characters & and followed by characters that are mistaken for variable names (inser

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Please check your SQL when the following error occurs. It must be the special character & in the value. If it is not used to delete it directly, if it is useful, then you need to deal with it (default insertion value with & symbol, and followed by a string, it will be mistaken for variable name).

Processing method (meaning to enclose & in single quotation marks and then process this column in a concatenation way)

will & replaced with '||'&'||'

The following prompt appears on plsql developer

In sqlplus is the following prompt

SQL> insert into va values ('T & K/Tyne Con'); Enter k for value: just a symbol I don't want to assign... original value 1: insert into va values ('T & K/Tyencon') New values 1: insert into va values ('T 'is just a symbol I don't want to assign.../ Tyncon ') has created 1 line. SQL> select * from va; FS_FAILOVER_OBSERVER_HOST--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- taienkang

Separate & from characters mistaken for variable names using single quotes and concatenation.

SQL> insert into va values('T'||'&'||'K/Tyne Con'); 1 line created. SQL> select * from va; FS_FAILOVER_OBSERVER_HOST--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In fact, followed by a space will not have an impact, you can insert directly.

SQL> insert into va values ('a7 &> d'); 1 line created. SQL> select * from va;FS_FAILOVER_OBSERVER_HOST--------------------------------------------------------------------------------a7 & >d

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report