DB2 Escape characters in queries

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Recently I had to use escape characters in DB2 queries and after looking through documentation here is a simple way to do this. You can define you escape character using

{escape '\'}

 

right after the statement your are trying to use it, here is a sample statement:

select oprid, oprdefndesc
from psoprdefn
where oprid like '%\_%' {escape '\'} 

I really want to know what you think