Escape character in Oracle-insert single quotation marks with ' & ' in Oracle

Source: Internet
Author: User
Tags chr

1. Single quotation mark

So what if the contents of the field contain single quotes? For example: It ' s fine. Method also has three
• Method One: Use escape characters
SQL > Select ' Test ' | | "From dual;
Note: What does the "four single quotes" mean? First and last are the string connectors in Oracle, this is no objection. So what does the second ' and third ' mean? The second ' is an escape character
The third ' is our real content.
• Method Two: The same is true with escape characters, except in a different way.
SQL > Select ' Test ' from dual;
Note: Here's the second, third ' is the escape character and the real content that we mentioned in method one above
• Method Three: replace ' in SQL ' with Chr (39) because Chr (39) is ' the ASCII code
SQL > Select ' It ' | | Chr (39) | | ' Fine ' from dual;

2. Replace ' & ' with Chr (38) In SQL statement, because CHR (38) is the ASCII code of ' & '

Reprint//:http://blog.163.com/fly_sky_java/blog/static/14042223420105221041496/

Escape character in Oracle-insert single quotation marks with ' & ' in Oracle

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.