Home » SQL & PL/SQL » SQL & PL/SQL » how to insert this value into table in oracle
how to insert this value into table in oracle [message #6562] Fri, 25 April 2003 01:49 Go to next message
krishnaveni
Messages: 3
Registered: April 2003
Junior Member
hello
there is one field of type varchar how to insert ' am
& ma' into the table without prompting for value of ma
and without removing space before and after & in
oracle

krishnaveni
Re: how to insert this value into table in oracle [message #6563 is a reply to message #6562] Fri, 25 April 2003 02:03 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
SQL> SET SCAN OFF

HTH,
MHE
Re: how to insert this value into table in oracle [message #6566 is a reply to message #6563] Fri, 25 April 2003 03:52 Go to previous messageGo to next message
Giridhar
Messages: 38
Registered: May 2001
Member
SQL> insert into inagkod (table_name) values ('NACT'||'&'||'ACCT');

1 row created.

SQL> select * from inagkod where table_name like 'NAC%';

TABLE_NAME COLUMN_NAME INDEX_NAME
-------------------- -------------------- --------------------
NACT&ACCT

SQL> show define
define "&" (hex 26)
SQL> set define off
SQL> insert into inagkod (table_name) values ('NACT&ACCT');

1 row created.

SQL> select * from inagkod where table_name like 'NAC%';

TABLE_NAME COLUMN_NAME INDEX_NAME
-------------------- -------------------- --------------------
NACT&ACCT
Re: how to insert this value into table in oracle [message #6571 is a reply to message #6562] Fri, 25 April 2003 08:02 Go to previous messageGo to next message
Anand
Messages: 161
Registered: August 1999
Senior Member
SET DEFINE OFF is the best solution.
Re: how to insert this value into table in oracle [message #6601 is a reply to message #6566] Mon, 28 April 2003 05:54 Go to previous message
BABU SRSB
Messages: 42
Registered: June 2002
Member
Hi All,

With out choosing SQL Plus commands also, you can insert the '&' character into the table.

check the below one.

SQL> desc ex;
Name Null? Type
------------------------------- -------- ----
ENO NUMBER
ENAME VARCHAR2(10)

SQL> select * from ex;

ENO ENAME
--------- ----------
1 sita
2 gita

SQL> insert into ex values (3, 'sita'|| chr(38) ||'gita');

1 row created.

SQL> select * from ex;

ENO ENAME
--------- ----------
1 sita
2 gita
3 sita&gita

SQL>

Have a nice day,

Babu SRSB
Previous Topic: How to avoid full table scan
Next Topic: how to find the user who executes sql statements
Goto Forum:
  


Current Time: Fri May 10 06:02:31 CDT 2024