BUG with ESCAPE CHARACTER in SQL QUERY ???
486717Jan 30 2006 — edited Jul 11 2006Hi !
I'm trying to escape some special characters (%, ', _ ) with Oracle 9.2 . I read in oracle documentation and on forums how to make this. The way given is :
SELECT last_name
FROM employees
WHERE last_name LIKE %\%%\_% ESCAPE \;
BUT this doesn't work for me:
"ORA-01425: Given escape character for LIKE is not a character string of length 1"
I try others ways :
- I changed the character '\' by '*' or '+', '!', ... and finally with 'a', 'c' but the result is the same.
- When i changed '\' by '\\' or 'N~', '\\\\' , ... the query is well-executed, but no row is found ,even if in my table there's employees with last_name 'aaa_zzz' .
If anybody can explained me why this? Or better if anybody knows how to solve this? Thanks a lot because i have no more ideas now ( is it an SQL bug, or a problem of configuration).