— tab_desc.sql
— mdw date? way back in the mists of time
— my own replacement for desc.
— 16/11/01 improved the data_type section
 SET PAUSE ON
 SET PAUSE ‘Any Key…>’
 SET PAGES 24
 col Tab_own form A10
 col tab_name form a22 wrap
 col col_name form a28 wrap
 col col_def form A14
 break on tab_own skip 1 on tab_name skip 1
 spool tab_desc.lst
 select
 owner                               Tab_Own
,table_name             Tab_Name
,column_name            Col_Name
,decode(NULLABLE,’Y’,’N’,’Y’)        Mand
,data_type||decode(data_type
       ,’NUMBER’,'(‘
        ||decode(to_char(data_precision)
                ,null,’38’
                ,     to_char(data_precision)||
                      decode(data_scale,null,”
                                      ,      ‘,’||data_scale)
                 )
                    ||’)’
       ,’DATE’,null
       ,’LONG’,null
       ,’LONG RAW’,null
       ,'(‘||Substr(DATA_LENGTH,1,5)||’)’
         )  col_def
from dba_tab_columns
where table_name like upper (nvl(‘&TAB_NAME’,’WHOOPS’)||’%’)
order by 1,2,column_id,3,4
/
spool off
clear col