Processing of special Oracle symbols: setdefineoff

Source: Internet
Author: User
Oracle special symbol processing, today encountered a problem, colleagues using dynamic SQL generated insert statement, which contains symbols, when doing insert, this symbol is used as

Oracle special symbol processing, today encountered a problem, colleagues using dynamic SQL generated insert statement, which contains symbols, when doing insert, this symbol is used as

Oracle special symbol & processing, today encountered a problem, the colleague uses the insert statement generated by dynamic SQL, which contains the & symbol, during the insert, this & symbol is used as a variable prompt. How can this problem be solved? It's actually quite simple: set define off

SQL> create tablet (avarchar2 (20 ));

Table created.

SQL> insertinto tvalues ('aaa & bbb ');
Enter valuefor bbb :.
Old1: insert into T values ('aaa & bbb ')
New1: insert into T values ('aaa .')

1 rowcreated.

SQL> rollback;

Rollback complete.

SQL>
SQL> -- wenow setdefine toOFF, theninsert data.
SQL> setdefine off
SQL> insertinto tvalues ('aaa & bbb ');

1 rowcreated.

SQL> select * from t;

A
--------------------
Aaa & bbb

SQL>

We found that the data with the & symbol has been inserted after set define off.

Related reading:

Handling of special Oracle symbols '&'

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.