WorkingScripts

The Stuff that Just Works

WorkingScripts header image 5

Entries from February 18th, 2009

DB2 Escape characters in queries

February 18th, 2009 No Comments

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, [...]

Tags:   ·