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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Escaping the &

Re: Escaping the &

From: Rod Corderey <RodCorderey_at_Lane-Associates.com>
Date: 2000/04/11
Message-ID: <38F38347.1071EDA7@Lane-Associates.com>#1/1

and yet another one

If you need to process data ampersands but also need to pass arguments, then use

set define <any character that will not be used in data>

eg set define ~		a tilde is a often a useful character for
			this purpose.

then instead of select....
		from ....
		where thing = &param

becomes		select ....
		from .....
		where thing = ~param

Rod Corderey

Lane Associates
RodCorderey_at_LAne-Associates.com
http://www.Lane-Associates.com

Girts Graudins wrote:
>
> > If I attempt to insert 'Sound & Music', Oracle always prompts me for
 the
> > value of Music
> > because it thinks I'm specifying a variable.
>
> All the above solutions will work, but
>
> SQL> set scan off;
>
> is the one that targets the real problem. Set scan off turns off the
> feature of SQL*Plus that looks for '&name' and interprets them as
> variables. This is especially useful if you want to compile a web page
> with lots of special characters like &nbsp; &amp;, etc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Girts Graudins
> Consulant
> The Exeter Group, Inc.
> ggraudins_at_hotmail.com
> http://www.exetergroup.com/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Apr 11 2000 - 00:00:00 CDT

Original text of this message

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