Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to update data inside a CLOB using SQL?

I have a table having one clob column which has XML data in it. Say I want to replace XYZ with ABC in the clob column. Is it possible using sqlplus?

like image 243
Hemant Avatar asked Jun 29 '10 10:06

Hemant


1 Answers

Why not try it ?

SQL> create table nnn(c1 clob);

Table created.

SQL> insert into nnn values ('text ABC end');

1 row created.

SQL> select * from nnn;

C1
-------------------------------------------------
text ABC end

SQL> update nnn set c1=replace(c1,'ABC','XYZ');

1 row updated.

SQL> select * from nnn;

C1
-------------------------------------------------
text XYZ end

SQL>
like image 72
N. Gasparotto Avatar answered Sep 28 '22 02:09

N. Gasparotto