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 -> Re: Escaping an underscore wildcard?

Re: Escaping an underscore wildcard?

From: <yewpc_at_my-dejanews.com>
Date: Fri, 18 Dec 1998 07:28:24 GMT
Message-ID: <75d06o$9ir$1@nnrp1.dejanews.com>


Try this way :
Set escape off

   Select tname from tab where tname like 'A\_%' escape '\';

In article <F451DI.8vy_at_world.std.com>,
  enquad_at_world.std.com (MWRA ENQUAD) wrote:
> 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.
>
> --
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Dec 18 1998 - 01:28:24 CST

Original text of this message

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