Two cases: 1. If there is no string at the end, it is a simple character, which is processed according to the character; 2. If there is a string at the end, according to Oracle
Two cases: 1. If there is no string at the end, it is a simple character, which is processed according to the character; 2. If there is a string at the end, according to Oracle
Two cases:
1. If & is not followed by a string, & is a simple character and is processed by character;
2. If & is followed by a string, perform the & operation as a variable according to Oracle;
The following is an attempt to address the above two situations:
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:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
The session has been changed.
SQL>
SQL> create table zzw_temp (name varchar2 (20 ));
The table has been created.
SQL> insert into zzw_temp (name) values ('zzw ');
One row has been created.
SQL> commit;
Submitted.
SQL> select * from zzw_temp;
NAME
--------------------
Zzw
SQL> insert into zzw_temp (name) values ('&');
One row has been created.
SQL> commit;
Submitted.
SQL> select * from zzw_temp;
NAME
--------------------
Zzw
&
SQL>
SQL>
SQL>
SQL>
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 3 has an error:
ORA-12899: the value of column "SYS". "ZZW_TEMP". "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 ')
One row has been created.
SQL> select * from zzw_temp;
NAME
Certificate ----------------------------------------------------------------------------------------------------------------------------------
Zzw
&
Https: // 192.168.0.1/index.html 123
SQL> insert into zzw_temp (name) values ('https: // 192.168.0.1/index.html '|' & '| 'http ');
One row has been created.
SQL> commit;
Submitted.
SQL> select * from zzw_temp;
NAME
Certificate ----------------------------------------------------------------------------------------------------------------------------------
Zzw
&
Https: // 192.168.0.1/index.html 123
Https: // 192.168.0.1/index.html & http
SQL>
SQL>