Is there an easy way in Oracle to escape special characters in a SQL statement? (i.e. %, &, ') I saw this link in regard to manually escaping characters, but I thought Oracle may have provided an easier way to do so.
Note: I'm generating dynamic SQL select statements through an ORM.
解决方案
If using bind variables and ORM, embedded single quotes and ampersands should be handed automatically; those are special characters in SQL*Plus or SQL*Developer.
To use LIKE where looking for the literal characters % and _ (not their multi- and single-character wildcard versions), you'd use the escape clause of the like condition:
select * from my_table where some_text like '/%%' escape '/';
will only return the rows where some_text begins with a percent sign.