日期:2014-05-17 浏览次数:21032 次
clob字段里的内容是这样的:
11.11.11.11
22.22.22.22
33.33.33.33
44.44.44.44
55.55.55.55/15:51.51.51.51
create table test_clob(id integer,info clob);
insert into test_clob values(2,'aaaaaaaaaa
bbbbbbbbbb
ccccccccccc
ddddddddd
eeeeeeeeeeee');
commit;
select * from test_clob;
declare
vv_buf varchar2(32767);
vv_buf1 varchar2(32767);
i integer;
begin
select t.info into vv_buf
from test_clob t where t.id = 2;
i := 1;
while instr(vv_buf,chr(10),i) >= 1 loop
vv_buf1 := substr(vv_buf,i,instr(vv_buf,chr(10),i)-i);
i := instr(vv_buf,chr(10),i) + 1;
dbms_output.put_line('---------------');
dbms_output.put_line(vv_buf1);
end loop;
if i <> length(vv_buf) then
dbms_output.put_line('---------------');
vv_buf1 := substr(vv_buf,i,length(vv_buf));
dbms_output.put_line(vv_buf1);
end if;
end;