Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL/plus question
Chris Sarjent wrote:
>
> Mark Webb wrote:
> >
> > Hi everyone,
> >
> > This must be a FAQ but I can't see how (if indeed it is
> > possible) to get an ampersand (&) into a character literal
> > in sql/plus.
> >
> > Something like:
> >
> > Insert into xxx values ('Me & you');
> >
> > Gives:
> >
> > please enter value for 'you':
> >
> > Thanks in advance.
> >
> > Mark W.
> Include SET DEFINE OFF in your script or issue it prior to executing
> your insert statement. The ampersand is the default substitution
> variable character. You can either turn this off or set it to another
> character using the SET DEFINE xxx statement.
>
> Chris Sarjent
You can also use SET SCAN OFF to avoid all variable substitution, or SET ESCAPE ON to allow the use of a '\' to cause sqlplus not to evaluate an individual &.
set escape on Insert into xxx values ('Me \& you');
-- Bob Swisshelm Eli Lilly and Company swisshelm_at_lilly.comReceived on Fri Apr 11 1997 - 00:00:00 CDT