Home » SQL & PL/SQL » SQL & PL/SQL » escape character for '&'
escape character for '&' [message #220594] Wed, 21 February 2007 06:07 Go to next message
karismapanda
Messages: 58
Registered: January 2007
Member
Hi,

How can i insert a data with value having & as a character.

e.g. I want to insert a value &app to a table

If i will try to insert it will ask me value for app.but i want to insert this value to the table.

any help appreciated.
Thanks,
Karisma
Re: escape character for '&' [message #220597 is a reply to message #220594] Wed, 21 February 2007 06:13 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

hi,

before insert set DEFINE OFF on SQL> prompt
set define off

or
set scan off 


regards
Taj

[Updated on: Wed, 21 February 2007 06:31]

Report message to a moderator

Re: escape character for '&' [message #220598 is a reply to message #220594] Wed, 21 February 2007 06:13 Go to previous messageGo to next message
pmaupoil
Messages: 40
Registered: February 2007
Location: France
Member
type "set define off"
Re: escape character for '&' [message #220600 is a reply to message #220594] Wed, 21 February 2007 06:17 Go to previous messageGo to next message
karismapanda
Messages: 58
Registered: January 2007
Member
Thanks
Re: escape character for '&' [message #220603 is a reply to message #220594] Wed, 21 February 2007 06:28 Go to previous messageGo to next message
j0zele
Messages: 15
Registered: December 2006
Junior Member
SQL>create table t (simb varchar2(50));

Tabla creada.

SQL> insert into t values ('hi&bye');
Introduzca un valor para bye: 1
antiguo   1: insert into t values ('hi&bye')
nuevo   1: insert into t values ('hi1')

1 fila creada.

SQL> select * from t;

SIMB
--------------------------------------------------
hi1

SQL> set escape on
SQL> insert into t values ('hi&\bye');

1 fila creada.

SQL> select * from t;

SIMB
--------------------------------------------------
hi1
hi&bye


Default escape value is \ put it after &

i hope it help

[Updated on: Wed, 21 February 2007 06:29]

Report message to a moderator

Re: escape character for '&' [message #220607 is a reply to message #220600] Wed, 21 February 2007 06:47 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
OraFAQ
By
Vamsi
Previous Topic: Automatic Export & Automatic Shutdown - Startup DB
Next Topic: Performance problem of connect by clause
Goto Forum:
  


Current Time: Sat Dec 03 04:15:42 CST 2016

Total time taken to generate the page: 0.06159 seconds