Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Escaping an underscore wildcard?

Escaping an underscore wildcard?

From: MWRA ENQUAD <enquad_at_world.std.com>
Date: Fri, 18 Dec 1998 01:56:06 GMT
Message-ID: <F451DI.8vy@world.std.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US