The operation of clob is different from other data types.
If you want to insert or update a clob column, you must do as below:
(1) you must go to the clob row firstly;
(2) then you can update clob column used by dbms_lob package(such as dbms_lob.write, dbms_lob.write, dbms_lob.writeappend);
Here is an easy example:
--------------------------------------------------------
Code:create table t_clob2 ( no number, content clob ); create or replace procedure sp_clob(ip_no number,ip_content varchar2) is lv_no number; lv_clob clob; lv_sqlstr varchar2(4000); begin insert into t_clob2 values(ip_no,empty_clob()); commit; lv_sqlstr := 'select content from t_clob2 where no=' || ip_no || ' for update'; execute immediate lv_sqlstr into lv_clob; dbms_lob.write(lv_clob,length(ip_content),1,ip_content); commit; end; SQL> exec sp_clob(1,'abcdefg'); PL/SQL procedure successfully completed SQL> select * from t_clob2; NO CONTENT -------------------------------------------------------------------------- 1 abcdefg /




Reply With Quote