Insert a string containing the & amp; symbol into the oracle database

Source: Internet
Author: User

Insert a string containing "&" into the oracle database: www.2cto.com 1. If "&" does not have a string, "&" is a simple character and is processed by character; 2. If & is followed by a string, follow oracle's statement to Operate & as a variable. Under www.2cto.com, an attempt is made for the above two cases: t5240.com % T5240.com % sqlplus '/as sysdba' SQL * Plus: Release 10.2.0.5.0-Production on Tuesday March 5 12:21:58 2013 Copyright (c) 1982,201 0, Oracle. all Rights Reserved. connect to: www.2cto.com Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-6 4bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options sessions have been changed. SQL> create table zzw_temp (name varchar2 (20); the table has been created. SQL> insert into zzw_temp (name) values ('zzw'); 1 row has been created. SQL> commit; submitted completely. SQL> select * from zzw_temp; NAME ------------------ zzw SQL> insert into zzw_temp (name) values ('&'); 1 line has been created. SQL> commit; submitted completely. SQL> select * from zzw_temp; NAME -------------------- zzw & SQL> insert into zzw_temp (name) values (' https://192.168.0.1/index.html & Http '); input http value: 123 original value 1: insert into zzw_temp (name) values (' https://192.168.0.1/index.html & Http ') New value 1: insert into zzw_temp (name) values (' https://192.168.0.1/index.html 123 ') insert into zzw_temp (name) values (' https://192.168.0.1/index.html 123 ') * row 1st error: ORA-12899: column "SYS ". "ZZW_TEMP ". the value of "NAME" is too large (actual value: 35, maximum value: 20) SQL> alter table zzw_temp modify name varchar2 (200); the table has been changed. SQL> insert into zzw_temp (name) values (' https://192.168.0.1/index.html & Http '); input http value: 123 original value 1: insert into zzw_temp (name) values (' https://192.168.0.1/index.html & Http ') New value 1: insert into zzw_temp (name) values (' https://192.168.0.1/index.html 123 ') You have created one row. SQL> select * from zzw_temp; NAME example --- zzw & https://192.168.0.1/index.html 123 SQL> insert into zzw_temp (name) values (' https://192.168.0.1/index.html '|' & '| 'HTTP'); 1 line has been created. SQL> commit; submitted completely. SQL> select * from zzw_temp; NAME example --- zzw & https://192.168.0.1/index.html 123 https://192.168.0.1/index.html & Http SQL>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.