Skip to Main Content
  • Questions
  • Escaping special characters session wide

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Daniel.

Asked: November 08, 2010 - 3:14 pm UTC

Last updated: November 10, 2010 - 8:02 am UTC

Version: 10.2.0.4

Viewed 1000+ times

You Asked

Hello Tom,

Our developer has asked about an option to escape Oracle special characters session wide, so for example he or she does not have to add ESCAPE '\' after the expression in the sql... I think it may be doable via log-on trigger...

I would like to get our opinion - is doing anything like that advisable? If yes, how would you do it? Any potential complication when developers will access the data via such altered session and then via java based application?

Thank you for your time.

Daniel

and Tom said...

... I think it may be doable via log-on trigger... ...

it is not, there is no way to "disable" % and _ in a like clause (the only place where an ESCAPE statement makes sense.

It is ANSI standard SQL, it is not an "oracle feature" or anything - it is the language itself, the specification for it.

Writing escape '\' isn't that onerous, it is proper SQL - it is the way it works.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library