You can query DBA_/ALL_/USER_IND_COLUMNS
, i.e.
SQL> SELECT index_name
2 FROM dba_ind_columns
3 WHERE table_owner = 'SCOTT'
4 AND table_name = 'EMP'
5 AND column_name = 'EMPNO';
INDEX_NAME
------------------------------
PK_EMP
Of course, you may want to expand the query a bit. This will pick up any index that the EMPNO column appears in. You may want to limit yourself to indexes where the column is the leading column of the index (COLUMN_POSITION
= 1). Or you may want to limit yourself to indexes just on that particular column (so that there is no column in COLUMN_POSITION
2), i.e.
SQL> ed
Wrote file afiedt.buf
1 SELECT index_name
2 FROM dba_ind_columns a
3 WHERE table_owner = 'SCOTT'
4 AND table_name = 'EMP'
5 AND column_name = 'EMPNO'
6 AND column_position = 1
7 AND NOT EXISTS( SELECT 1
8 FROM dba_ind_columns b
9 WHERE a.index_owner = b.index_owner
10 AND a.index_name = b.index_name
11* AND b.column_position = 2)
SQL> /
INDEX_NAME
------------------------------
PK_EMP