Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how to copy data from long to varchar2
"Martin T." <bilbothebagginsbab5_at_freenet.de> schrieb im Newsbeitrag news:1162542003.960987.301590_at_b28g2000cwb.googlegroups.com...
> Peter Keckeis wrote:
>>
>>
>>
>>
>> > > Hm. Well I tried the script on my 9i2 and the values were copied as > expected ... but of course I only had a very small amount of test data. > Can you log the long values read via dbms_output in the script? > How long are your Longs anyway? > And, is this a one-off thing you are trying here? As Frank said it > might be a good idea to get rid of that long column. > > cheers, > Martin >
i made the following changes in the PL/SQL Script:
begin
for reco in (
select pk,l_txt
from test
for update
) loop
update test set vc_txt = substr(reco.l_txt,1,2000) where pk = reco.pk;
end loop;
end;
(pk = primary key field)
and now, it works fine.
cheers,
Peter
Received on Mon Nov 06 2006 - 01:41:42 CST