RE: How to suppress special characters in query

I tried the google and don't want to use the set option and the escape
sequence specified in article is not working (I am not sure if it works
for &). Following is the output from sqlplus:

 

SQL> select * from tab1

  2  where col1 like 'A \& b%' ESCAPE '\';

Enter value for b: 

 

It works as an set option but not in the query and I was looking for
something to work in the query without the set option:

SQL> set ESCAPE '\'

SQL> select * from t_account_mapper

  2  where nm_login like 'A \& b%';

 

no rows selected

 

________________________________

From: Carel-Jan Engel [mailto:cjpengel.dbalert@xxxxxxxxx] 
Sent: Monday, February 05, 2007 4:15 PM
To: Harvinder Singh
Cc: oracle-l
Subject: Re: How to suppress special characters in query

 

Entering 
'oracle SQL special character'

In the google search box led me to:
http://orafaq.com/faq/how_does_one_escape_special_characters_when_writin
g_sql_queries

(2nd hit)

Please keep in mind that this list is not a search engine, nor an
automagic answering machine.
A little effort and research is expected and required, before turning to
the list, otherwise you might find yourself being ignored when you come
up with a serious question.

Best regards,

Carel-Jan Engel

===
If you think education is expensive, try ignorance. (Derek Bok)
=== 


On Mon, 2007-02-05 at 16:02 -0500, Harvinder Singh wrote: 

 
Hi,
 
We have a query like following that includes the & symbol and since this
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'
 
Thanks
--Harvinder
 
--
http://www.freelists.org/webpage/oracle-l
 
 

 

 

 

Other related posts: