Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to find and update clob content?
see example:
drop table lobtest;
create table lobtest (c1 clob);
insert into lobtest values ('12345678901234567890');
select c1, dbms_lob.getlength(c1) from lobtest;
declare
len number;
begin
for r1 in (select c1 from lobtest for update ) loop
len := dbms_lob.getlength(r1.c1);
dbms_lob.trim(r1.c1, len - 10);
end loop;
end;
/
select c1, dbms_lob.getlength(c1) from lobtest;
Regards,
Andre van Winssen
"Susan Lam" <susana73_at_hotmail.com> wrote in message
news:7186ed56.0202052307.4195e11a_at_posting.google.com...
> I have a 10 million records table with a clob column storing text
> average 5k. A typo is found in the text which affect around 1 million
> records. What I need to do to that million records is to remove the
> last 10 characters of the clob. Is there any easy way to do such as
> using pl/sql package dbms_lob?
>
> P.S. I have already identify all the defective records so I do not
> need to search for them. I just need a way to update them.
>
> Thanks,
> Susan
Received on Wed Feb 06 2002 - 03:02:41 CST