Click to See Complete Forum and Search --> : Bug with LIKE ?


cjard
03-16-2007, 06:11 PM
I have some stored procedures with a single underscore in the name:

TEST2_200601011234
TEST2_200701011234


Can someone tell me why the following queries returns two records:

SELECT * FROM user_procedures WHERE object_name LIKE 'TEST2__%'
SELECT * FROM user_procedures WHERE object_name LIKE 'TEST2_______%'

If _ is the wildcard for a single character, how do I turn that off?

cjard
03-16-2007, 06:14 PM
If _ is the wildcard for a single character, how do I turn that off?

It is..

SELECT ... LIKE 'TEST2\_%' ESCAPE '\'