Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Inserting "&" in SQL*Plus
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
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
SQL> set escape on
SQL> insert into test_table values ('a \& b industries');
1 Zeile wurde erstellt.
SQL> select * from test_table;
COMP_NAME
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
--
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
![]() |
![]() |