Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to include '&' in a varchar2 insert statement?
Thanks, set define off seems to work. I just wonder what other side effects are
in effect during that time I set it off now? There is not way to just escape the
"&"?
Mike
Diane wrote:
> In article <36c4a9e2.9462957_at_192.86.155.100>, Thomas Kyte
> <tkyte_at_us.oracle.com> writes
> >A copy of this was sent to gremlin <gremlinNO__SPAM___at_ix.netcom.com>
> >(if that email address didn't require changing)
> >On Mon, 08 Feb 1999 22:12:06 -0500, you wrote:
> >
> >>Hi:
> >>
> >>I am having difficulty getting an embedded '&' string into a varchar to
> >>insert statement. For instance, how would I insert the value "Wiley &
> >>Sons" into a varchar2 column ?
> >>
> >>Using Oracle 8.0.4.1 on an SGI.
> >>
> >>TIA,
> >> Mike
> >
> >I assume you must be using sqlplus and when you try to:
> >
> >
> >SQL> insert into t values ( 'Wiley & Sons' );
> >Enter value for sons:
> >old 1: insert into t values ( 'Wiley & Sons' )
> >new 1: insert into t values ( 'Wiley ' )
> >1 row created.
> >
> >SQL> set define off
> >
> >SQL> insert into t values ( 'Wiley & Sons' );
> >1 row created.
> >
> >SQL> select * from t;
> >
> >X
> >-------------------------
> >Wiley
> >Wiley & Sons
> >
> >
> >if you set define off -- it'll work in sqlplus.
> >
> >
> >Thomas Kyte
> >tkyte_at_us.oracle.com
> >Oracle Service Industries
> >Reston, VA USA
> >
> >--
> >http://govt.us.oracle.com/ -- downloadable utilities
> >
> >----------------------------------------------------------------------------
> >Opinions are mine and do not necessarily reflect those of Oracle Corporation
> >
> >Anti-Anti Spam Msg: if you want an answer emailed to you,
> >you have to make it easy to get email to you. Any bounced
> >email will be treated the same way i treat SPAM-- I delete it.
>
--
![]() |
![]() |