Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Updating clob values

kparthiApr 5 2016 — edited Apr 5 2016

Hi , Until now i am using the normal update command in PL/SQL Block for updating new values in clob column. Recently read about the DBMS_LOB package and its usages but i am unable to distinguish the difference between normal update / DBMS_LOB.WRITE of clob column in a table with new value

Scenario updating the new values in the clob column .

If any one can update me the usage of dbms_lob usage it would be an great help to me .

desc z_export

Name  Null Type

----- ---- ----

ID         NUMBER

VALUE      CLOB

-- Normal updated

;

BEGIN

  UPDATE z_export

  SET value = '<CPF><requesttype>ReferenceType</requesttype>'

  WHERE id  =1;

END;

/

-- dbms_clob update

DECLARE

  l_clob CLOB;

  l_value VARCHAR2(500) := '<CPF><requesttype>ReferenceType</requesttype>sample update ';

BEGIN

  SELECT value INTO l_clob FROM z_export WHERE id=1 FOR UPDATE ;

  DBMS_LOB.WRITE(l_clob, LENGTH(l_value), 1, l_value);

  --commit;

END;

/

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 3 2016
Added on Apr 5 2016
12 comments
24,909 views