Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to find and update clob content?

Re: How to find and update clob content?

From: Andre van Winssen \(andrew\) <andrew_at_info.nl>
Date: Wed, 6 Feb 2002 10:02:41 +0100
Message-ID: <3c60f132$0$220$4d4ebb8e@news.nl.uu.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US