PDA

View Full Version : Ampersand causing problems on select


BigDaddy
01-05-2004, 04:20 PM
Using Oracle, doing a select statement where the value I'm looking for has an ampersand in it causes problems. Apparently, Oracle is seeing it as me wanting to define a variable.

I think this is similar to the ' and '' error that you get if you don't do a replace on single-quotes. to double them.

Anyone know how to search by a word containing an ampersand in Oracle?

A1ien51
01-05-2004, 05:01 PM
look at this
http://www.orafaq.com/faqplus.htm#NOAT

BigDaddy
01-05-2004, 05:14 PM
Even better, I'm needing to pass the value of the field in a querystring. The receiving ASP page interprets the value as being 2 fields.

I'm thinking we need to either limit the info that goes into this table to not include ampersands, or we need to use unique identifier keys to identify individual records in the table. That way I can pass a 3-4 digit variable insted of a 30 character long name.

glenngv
01-06-2004, 04:21 AM
You should url encode the querystring so that the querystring with ampersand in it, is not interpreted as 2

<%
qs = "You & me"
response.redirect "page2.asp?qs=" & Server.URLEncode(qs)
%>