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: SQL/plus question

Re: SQL/plus question

From: Larry W. Liebau <lliebau_at_ford.com>
Date: 1997/04/11
Message-ID: <334E5829.34E1@ford.com>#1/1

QuadTwin wrote:
>
> mwebb_at_cix.compulink.co.uk ("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.
>
> There may be an option on the SQL*PLUS SET command to change the
> delimiter used to precede a substitution variable reference. SQL*PLUS
> uses ampersand "&" to signal the need for the operator to provide a value
> for the variable whose name follows the ampersand, in this case the
> word "you" is assumed to be the name of that variable.
>
> If you can't find a way to redefine the character used for this purpose,
> you can do your insert this way:
>
> Insert into xxx values ('Me ' || chr(38) || ' you');
>
> The value 38 is the ASCII numeric equivalent to ampersand. CHR is
> the handy ASCII numeric to character conversion function.
>
> Al Lawson
> Interactive Group, Inc.
> www.interactive-group.com
> lawsona_at_interactive-group.com

Or if you don't need variable substitution, use SET DEFINE OFF

-- 
Larry W. Liebau                 
Q&PL - QPIS                     PROFS: LLIEBAU
Ford Motor Co.                  Phone: 313-33-71614
<<< All standard disclaimers apply! >>>
Received on Fri Apr 11 1997 - 00:00:00 CDT

Original text of this message

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