tags:

views:

142

answers:

3

I need to find records containing html code such as '&nbsp' But when I try to run the select * from table_name where column like '&nbsp%' I got prompt asking for the value of nbsp. I guess the database thinks that nbsp is a parameter. I am wondering if the is an escape character so that I can tell the database that "&" is part of my query string. I tryed '\&nbsp' but didn't work.

My environment is Oracle 9i with sqlplus client.

Thanks.

+1  A: 

The backslash should work, but I think you need to start your query with

SET ESCAPE ON
Paddyslacker
+8  A: 

Have a look at this:

SQL Plus FAQ

e.g.

SET ESCAPE '\'
SELECT '\&abc' FROM dual;
davek
Works well. thanks.
Wei Ma
+8  A: 

Easier way:

SET DEFINE OFF

See: SET DEFINE

Wade Williams
This works very well too. But I saw another answer first, so I had to mark the other one as answer. But one up vote for you :)
Wei Ma