Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Escaping an underscore wildcard?
I have production tables and work tables in the same tablespace.
Each worktable is given a letter prefix followed by an underscore
to distinguish it from the production tables, and to allow all
worktables with a common prefix to be identified. We use Oracle v7.1.
I would like to be able to do the following:
Select tname from tab where tname like 'A_%';
The problem is that the underscore is a single character wildcard. So in addition to returning tablenames like A_APPLE, I also get APPLE.
I thought that I might be able to use the backslash as an escape like this:
Set escape on
Select tname from tab where tname like 'A\_%';
but the backslash is ignored and the underscore is still used as a
wildcard. It seems that the escape only works to escape variable
substitution not wildcard substitution.
I would love to be able to temporarily change the wildcard character to something other than and underscore, but this doesn't seem possible.
Any suggestions. Thanks.
-- Received on Thu Dec 17 1998 - 19:56:06 CST