Is it possible to update data inside CLOB using SQL?

I have a table with a single clob column that has XML data in it. Let's say I want to replace XYZ with ABC in the clob column. Is using sqlplus possible?

+5
source share
3 answers

"I have a new row in the column. Tips?"

- ; , , . , CHR(), ASCII . , , . MS Windows, (ASCII = 10), (ASCII = 13).

SQL> select * from t42
  2  /

TXT
--------------------------------------------------------------------------------
<ABC> ABCD
  </ABC>


SQL>  update t42 set txt=replace(txt,'ABCD'||chr(10)||chr(13), 'APC woz here')
  2  /

1 row updated.

SQL> select * from t42
  2  /

TXT
--------------------------------------------------------------------------------
<ABC> APC woz here </ABC>

SQL>

, XML-, , XMLType CLOB. .

+5

?

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>
+6

, REPLACE(). :

update nnn set c1 = REPLACE(c1,'ABC>','XYZ>')
0

All Articles