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