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

Hemant picture Hemant · Jun 29, 2010 · Viewed 52.6k times · Source

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?

Answer

N. Gasparotto picture N. Gasparotto · Jun 29, 2010

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>