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: QuadTwin <quadtwin_at_aol.com>
Date: 1997/04/11
Message-ID: <19970411131501.JAA19974@ladder01.news.aol.com>#1/1

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 Received on Fri Apr 11 1997 - 00:00:00 CDT

Original text of this message

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