myorama
4/26/2017 - 4:13 PM

get_index_columns.sql

set line 200
col columns for a100
select i.table_name, i.index_name, listagg(i.column_name, ',') within group (order by i.column_position) columns
 from dba_ind_columns i
 left join dba_constraints c on i.index_name = c.index_name
where i.index_owner = '&owner' and i.table_name = '&table' 
group by i.table_name, i.index_name;