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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to suppress special characters in query

Re: How to suppress special characters in query

From: Nuno Souto <dbvision_at_iinet.net.au>
Date: Tue, 6 Feb 2007 13:52:12 +1100
Message-ID: <1170730332.45c7ed5c99992@mail.iinet.net.au>


Quoting Harvinder Singh <Harvinder.Singh_at_MetraTech.com>:

> is a special character so Oracle prompts for the input. Is there any way
> to suppress this special character in a query without using the set
> define off option at sqlplus session?
>
> Select * from tab1 where col1 like = 'A & B'
>

how about this:

  1* create table tab1 (col1 varchar2(20)) SQL> / Table created.

SQL> insert into tab1 values ('A '||'&'||' B');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from tab1
  2 where col1 like 'A '||'&'||' B';
Press return to continue...

COL1



A & B

1 row selected.

works for me...

-- 
Cheers
Nuno Souto
from sunny Sydney
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Feb 05 2007 - 20:52:12 CST

Original text of this message

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