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 can insert '&' in my string?

Re: How can insert '&' in my string?

From: Lothar Armbruester <lothar.armbruester_at_rheingau.netsurf.de>
Date: 1998/02/19
Message-ID: <1112.354T142T12012309@rheingau.netsurf.de>#1/1

On 19-Feb-98 11:34:33 News wrote:

>Hi, I got a problem, please help me!
>I want to insert a string with '&' into my table, but Oracle always
>recognized the &... as a variable and asked me to input a value... Here's my
>trouble...
> create table test ( name varchar2(32) );
> insert into test values ('Butter&Bread');
>then it asked me to input the Bread variable, :(
>How can I tell Oracle I want & to be & but not a variable prefix? I tried
>'\&' ,'"&' , '&&', but they didn't work and I can't get information from my
>reference book, could someone help me about it? Please! Thanks.
>BTW, how about single quotation mark?

Hello!
Just put

set define off

at the beginning of your script. If you enter your commands interactively, you can put this line in you login.sql so you don't have to worry about it until you really need such variables.
This solution works for SQL*Plus, but I have not tried it with SQL*Worksheet.

Hope that helps,
Lothar

--
Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Schulstr. 12            | lothar.armbruester_at_t-online.de
D-65375 Oestrich-Winkel |
Received on Thu Feb 19 1998 - 00:00:00 CST

Original text of this message

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