— ind_cols.sql
— mdw – list of all indexes and columns for given table_name start
clear breaks
clear col
col ind_owner form a11 wrap
col ind_name form a18 wrap
col tab_name form a18 wrap
col col_name form a20 wrap
set pause on
set pause ‘Any Key…>’
set array 1
set pages 24
break on ind_owner nodup on ind_name nodup on tab_name skip 1
spool ind_cols.lst
 INDEX_OWNER                 ind_owner
,INDEX_NAME                  ind_Name
,TABLE_NAME                  tab_Name
,substr(column_position,1,3) Psn
,COLUMN_NAME                 Col_Name
from all_ind_columns
–where table_name like upper(nvl(‘ampersanstab_name’,’WHOOPS’)||’%’)
where table_name = upper(nvl(‘&tab_name’,’WHOOPS’))
and table_owner like upper(nvl(‘&tab_own’,’WHOOPS’)||’%’)
order by 3,1,2,4,5
spool off