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: inserting the value "&"

Re: inserting the value "&"

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 29 Dec 2002 23:59:39 -0800
Message-ID: <92eeeff0.0212292359.37e195f1@posting.google.com>


"Moritz Klein" <mklein_at_students.uni-mainz.de> wrote in message news:<auo4l3$68$1_at_bambi.zdv.Uni-Mainz.DE>...
> Moritz Klein wrote:
> > Hello NG,
> > a problem again but other project.
> > I need to insert a & into a field and got stuck with how to escape
> > this character properly.
> > As to say i am standing on a hose. ;-) (wonder if has same meaning
> > like in Germany).
> >
> > Greetz
> > Moritz
> This is the query:
> INSERT INTO dirs (dirName,ip) values ('/BALD RUNTER/Simon & Garfunkel - The
> Definitive (1994)/','134.93.40.167');
>
> This is what Oracle prints out:
> Enter value for garfunkel: old 1: INSERT INTO dirs (dirName,ip) values
> ('/BALD RUNTER/Simon & Garfunkel - The Definitive (1994)/','134.93.40.167')
> new 1: INSERT INTO dirs (dirName,ip) values ('/BALD RUNTER/Simon
> OEM_sqlplus_input_finished - The Definitive (1994)/','134.93.40.167')
>
> 1 row created.

Try this,

INSERT INTO dirs

    (dirName,
     ip)
  VALUES
    ('/BALD RUNTER/Simon '|| CHR(38) ||' Garfunkel - The Definitive (1994)/',      '134.93.40.167');

CHR(38) is the ASCII value of &.

Regards
/Rauf Sarwar Received on Mon Dec 30 2002 - 01:59:39 CST

Original text of this message

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