Sunday, February 7, 2010

inserting string containing '&' in table.

How can a string like ':&nbnc' be inserted in a table.
This string is using as is bind variable but not actually it is so.

To insert this or similar string into a table, use

SET DEFINE OFF

Then use insert statement. For example,

SQL> desc t2;
Name Null? Type
----------------------------------------- -------- -------------

C1 VARCHAR2(10)

SQL> insert into t2 values(':&nbnc');
Enter value for nbnc: rr
old 1: insert into t2 values(':&nbnc')
new 1: insert into t2 values(':rr')

1 row created.

SQL> SET DEFINE OFF
SQL> insert into t2 values(':&nbnc');

1 row created.

SQL>

No comments:

Post a Comment

Please write your comments here.