오라클

List all indexes for a given table

OEasy 2006. 12. 26. 15:50
/* ************************************************************* */
/* List all indexed columns for a given table                    */
/*                                                               */
/* ************************************************************* */
break on index_name skip 1
col index_name  format a30
col uniuenes    format a12
col column_name format a30
prompt Indexes for table: &&1
select c.index_name, i.uniqueness, c.column_name
from   user_indexes i, user_ind_columns c
where  i.index_name = c.index_name
  and  i.table_name = upper('&&1')
order  by c.index_name, c.column_position
/
undef 1