Insert a signed string into the Oracle database

Source: Internet
Author: User
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>

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.