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 ‘\’}
.csharpcode, [...]