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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to escape the ampersand in a string.

Re: How to escape the ampersand in a string.

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sun, 05 Dec 1999 17:54:46 -0500
Message-ID: <f8rl4s000l9pp8lrc3nid5ellhel7kndmf@4ax.com>


A copy of this was sent to "Björn-Åke Segrell" <pinne_at_pegit.se> (if that email address didn't require changing) On Sun, 05 Dec 1999 16:53:20 +0100, you wrote:

>Hi,
>
>How the he.. do I escape the &-sign (ampersand) in a VARCHAR2 host
>variable
>in PL/SQL ?
>I've tried '&&', '\&', '/&', etc and searched the doc and the net as
>crazy. But i just can't find it.
>
>If someone knows the answer or where I can find it + maybe have some
>good FAQ-links
>for Oracle development (for this must surely be one).
>
>/Cheers

the & is a special character to SQLPlus (it is a sqlplus'ism).

it is used for macro variable substition.

you can:

SQL> set define off

to disable it. no escaping needed.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Sun Dec 05 1999 - 16:54:46 CST

Original text of this message

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