When you query the ALL_TAB_COLS view on Oracle 9i, it lists columns marked as UNUSED as well as the \'active\' table columns. There doesn\'t seem to be a field that explicit
Try using ALL_TAB_COLUMNS instead of ALL_TAB_COLS. In Oracle 11.2 I find that unused columns appear in ALL_TAB_COLS (though renamed) but not in ALL_TAB_COLUMNS.
I created a table like this:
create table t1 (c1 varchar2(30), c2 varchar2(30);
Then set c2 unused:
alter table t1 set unused column c2;
Then I see:
select column_name from all_tab_cols where owner='ME' and table_name='T1';
COLUMN_NAME
-----------
C1
SYS_C00002_10060107:25:40$
select column_name from all_tab_columns where owner='ME' and table_name='T1';
COLUMN_NAME
-----------
C1