Introduction:
This post is very simple, but usefull, as when I tried to find this thing on google, I couldnt get any page, may be I didnt search properly, but I wanted to share how we can insert & as a column value. This post is very useful if you are inserting thousands of records and all have & in one of the column values. As if you will try to run in SQL*PLUS, it would be asking you the value for a variable preceeding &.
Reolution:
We did differnet testings, and finally was able to insert the & as a column value, following are the testings and results.
1- created an empty table with one field as text varchar2(60).
test-sql>create table testtable (text varchar2(60));
Table created.
2- different tries to insert the &, last one is successfull.
a- test-sql>insert into testtable values(' this is & record');
Enter value for record: &
old 1: insert into testtable values(' this is & record')
new 1: insert into testtable values(' this is &')
1 row created.
test-sql>select * From testtable;
TEXT
------------------------------------------------------------
this is &
b- test-sql>insert into testtable values(' this is '&' record');
insert into testtable values(' this is '&' record')
*
ERROR at line 1:
ORA-00917: missing comma
c- test-sql>insert into testtable values(' this is "&" record');
1 row created.
test-sql>select * From testtable;
TEXT
------------------------------------------------------------
this is &
this is "&" record
d- test-sql>insert into testtable values(' this is '''&''' record');
insert into testtable values(' this is '''&''' record')
*
ERROR at line 1:
ORA-00917: missing comma
e- test-sql> insert into testtable values (' this is ' '&' ' record');
1 row created.
test-sql>select * From testtable;
TEXT
------------------------------------------------------------
this is &
this is "&" record
this is & record
This blog contains different things for Oracle DBA, APPS DBA and Middleware technologies. All these things should be tested first on test environments before applying in the Prod environments, please follow the standard Change control to apply all the PreProd and Prod changes. Also to make this blog more useful, please give your comments and share your experience. Thanks
Search This Blog
Subscribe to:
Post Comments (Atom)
Oracle 19c - patch 19.22 unavailability for Windows platform
Oracle 19c - patch 19.22 unavailability for Windows platform Having upgraded the Oracle 11g 11.2.0.4 database to Oracle 19c 19.3.0.0.0 whi...
-
Oracle 12c Installer error - [INS-10102] Installer initialization failed - no oraInstaller in java.library.path - make sure oraInst.lo...
-
Introduction: This post is related to describe the Report server issue with Oracle 9i AS R2. For this release of Application Server, the X S...
-
Introduction: In this article we will see, the impact of "Parallel" clause of rebuilding a partition index. We would also enable t...
No comments:
Post a Comment