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 "&" in SQL*Plus

Re: Inserting "&" in SQL*Plus

From: Jan Nowitzky <nowitzky_at_informatik.uni-jena.de>
Date: Fri, 13 Aug 1999 09:38:53 +0200
Message-ID: <37B3CB8D.90446B9@informatik.uni-jena.de>


Hi Matt,

if you want to escape this sign ('&'), you must do this! Escape a system used sign is '\' (default), but you must enable this. Now a little scenario:

SQL> create table test_table (comp

    Tabelle wurde angelegt.

SQL> insert into test_table values ('a & b industries');

    Geben Sie einen Wert für b ein:
    alt 1: insert into test_table values ('a & b industries')     neu 1: insert into test_table values ('a industries')

    1 Zeile wurde erstellt.

SQL> select * from test_table;

    COMP_NAME



    a industries

SQL> insert into test_table values ('a \& b industries'); Geben Sie einen Wert für b ein:
alt 1: insert into test_table values ('a \& b industries') neu 1: insert into test_table values ('a \ industries')

1 Zeile wurde erstellt.

SQL> select * from test_table;

    COMP_NAME



    a industries
    a \ industries

SQL> set escape on
SQL> insert into test_table values ('a \& b industries');

1 Zeile wurde erstellt.

SQL> select * from test_table;

COMP_NAME



a industries
a \ industries
a & b industries

Hope it helps!

Regards, Jan

Ramesh Subbyian wrote:

> & is the default character for define envionment option in SQL PLUS. Try
> after swiching it off. you can do that from options-->enviornment in SQL
> plus.
>
> Matt Kelly wrote:
>
> > Question:
> >
> > INSERT INTO test_table (company_name) VALUES ('a & b industries');
> >
> > What can I use to ESCAPE the "&" in the example above?
> >
> > SQL*Plus keeps prompting me for the value of "b", but I only
> > want to store the text string "a & b industries".
> >
> > Please email me if you know the answer!
> >
> > Thanks,
> >
> > --
> > Matthew Kelly
> > mkelly_at_clark.net
>
> --
> Ramesh Subbyian Work : 650-413-1217
> http://www.inventa.com Pager : 888-709-3153

--



Jan Nowitzky o Friedrich-Schiller-Universität o Institut für Informatik o
D-07740 Jena o Tel. +49/3641/9-46363 o
E-Mail nowitzky_at_informatik.uni-jena.de | jan.nowitzky_at_sap-ag.de
---------------------------------------------------------------------------


Received on Fri Aug 13 1999 - 02:38:53 CDT

Original text of this message

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