Re: inserting & into a table

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Tue, 29 Jul 2003 16:26:45 GMT
Message-ID: <MPG.1990401d9527c2ed989815_at_news.la.sbcglobal.net>


Hi Alan Mills, thanks for writing this:
> Presumably in SQL*Plus.
>
> SET ESCAPE \
>
> insert into table(col1) values ('Mani\&Anuj');
>
>
> "Manikandan" <member12054_at_dbforums.com> wrote in message
> news:3159506.1059463035_at_dbforums.com...
> >
> > Hi,
> > I have to insert '&' value to my column.
> > For ex.
> > My insert statement will be
> > insert into table(col1) values('Mani&Anuj');
> > But the values 'Mani&Anuj' is populated at run time.
> >
> > Please guide me!
> >
> > --
> > Posted via http://dbforums.com
>
>
>

[Quoted] You can also temporarily change the character that prompts for input from an ampersand to another unused character. For example:

set define #
insert...values('Mani&Anuj');
set define &

The advantage to this method is that you don't have to go thru your sql script and "escape" every ampersand.

-- 
[:%s/Karsten Farrell/Oracle DBA/g]
Received on Tue Jul 29 2003 - 18:26:45 CEST

Original text of this message