append()方法
append(desc_lob,src_lob)
1用于将一个源lob中的数据添加到目标lob的末尾
2该方法分别针对blob,clob,noclob

append存储过程的语法如下:
dbms_lob.append(
dest_lob in out nocopy blob,
src_lob in blob);
dbms_lob.append(
dest_lob in out nocopy clob/noclob character set any_cs,
src_lob in clob/noclob character set dest_lob%charset);

参数的含义如下:
dest_lob:目标lob,追加数据到该lob末尾。
src_lob:是源lob,从该lob中读取数据
character set any_cs:表示dest_lob 中的数据可以是任何字符集
character set dest_lob%charset:表示desc_lob的字符集.

测试数据


 create table  clob_table(
id number,
clob_column clob not null
);

--添加数据
--to_clob 将字符数据转换为clob类型
insert into clob_table values(1,to_clob('this is clob data'));
insert into clob_table values(2,to_clob('这是clob数据'));
select * from clob_table;

这里写图片描述

举例

create or replace procedure append_clob 
as
  src_lob clob;  
  dest_lob clob;  

begin  
  select clob_column into dest_lob from clob_table where id=1 for update;
  select clob_column into src_lob from clob_table where id=2  for update;
  dbms_lob.append(dest_lob,src_lob);  
end append_clob;
/

exec append_clob;
select * from clob_table;

这里写图片描述

posted on 2017-06-03 15:04  2637282556  阅读(543)  评论(0编辑  收藏  举报