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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Calculating the size of a Long column

Re: Calculating the size of a Long column

From: Charlotte Hammond <charlottejanehammond_at_yahoo.com>
Date: Fri, 19 Aug 2005 02:02:13 -0700 (PDT)
Message-ID: <20050819090213.11538.qmail@web33103.mail.mud.yahoo.com>


Hi Chris,

Would something like this work?

declare
v_longest integer := 0;
begin
for x in (select longcolumn from table) loop
  if length(x.longcolumn) > v_longest then     v_longest := length(x.longcolumn);
  end if;
end loop;
dbms_output.put_line(v_longest);
end;
/

Charlotte

>>
>>
>>

        Chris Dunscombe <chris_at_thedunscombes.f2s.com
>>>Sent by: oracle-l-bounce_at_freelists.org
>>19/08/2005 08:34
>>Please respond to chris
>>
>> To: Oracle-L <oracle-l_at_freelists.org
>>> cc:
>> Subject: Calculating the size of a Long column

>>
>>
>>I've a largish table (24 GB) with a long column. I'd
like to convert it to a
>>varchar2 (easier to use than a CLOB) as I believe
that the data stored in the
>>long isn't actually very long.
>>
>>However I don't know of an easy way (I could use
Perl/Python/PLSQL etc and
>>select the col in every row and do a length of the
resulting strings) to
>>calculate the max size for the long col given I
can't use vsize 'cos it's a
>>long of course. Any ideas?
>>
>>BTW it's 8.1.7 on HP
>>
>>Thanks,
>>
>>Chris Dunscombe
>>
>>www.christallize.com
>>--
>>http://www.freelists.org/webpage/oracle-l
>>
>>
>>
>>
                



Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs  
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 19 2005 - 04:04:17 CDT

Original text of this message

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