spool show_ndx.rslt 

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

break on xTABLE on xINDEX; 
 
/* ************************************************ */
/*                                                  */
/* Author            : Rick Kupcunas                */
/*                   : rick@kupcunas.com            */
/* Name		     : show_ndx.sql                 */
/* Run: @C:\rkupcuna05_ora\OracleDBA\SQL\show_ndx.sql  */
/* Original          : 2009-Sep-30                  */
/*                                                  */
/* This script will Shows data for a given view     */
/*                                                  */
/* ************************************************ */

col xTABLE format a20
col xINDEX format a30
col xNUM format a3
col xATTRIBUTE format a20

select substr(TABLE_NAME, 1, 20)     xTABLE,    
       substr(index_name, 1, 30)     xINDEX,
       substr(to_char(column_position, '99'), 1, 3) xNUM,
       substr(column_name, 1, 20)    xATTRIBUTE
from all_ind_columns
where table_name = upper('&&TABLE_NAME') 
order by 1 asc,
         2 asc,
         3 asc,
         4 asc;
         
set echo off;
spool off;
undefine TABLE_NAME;
set long 80;
commit;










