spool length01.rslt 

set linesize 80;
set pagesize 1000;
set long 50;
set echo on;

break on "ATTRIBUTE";
 
/* ************************************************ */
/*                                                  */
/* substitute the table_name variable with the new  */
/* name in CAPITAL LETTERS                          */
/*  - will show all the size of a given attribute   */
/*    on a given table.                             */
/*                                                  */
/*         @c:\oracle\sql\length01.sql              */ 
/*                                                  */
/* ************************************************ */

select length(&&ATTRIBUTE_NAME)           "LENGTH",
       count(length(&&ATTRIBUTE_NAME))    "COUNT"
from &&TABLE_OWNER..&&TABLE_NAME
group by length(&&ATTRIBUTE_NAME)
order by 1 asc;

undef TABLE_OWNER;
undef TABLE_NAME;
undef ATTRIBUTE_NAME;
         
set echo off;
spool off;
set long 80;
commit;










