I thought about using the following query
select owner,table_name
from all_tab_columns
where column_name in ('A_COLUMN','B_COLUMN');
but this is not a solid test because something like
create view my_view as
select a_column xxx
from my_table;
would show the column name as XXX, not as A_COLUMN.
The easiest way to do it is to find out what views reference your table and then look at the view to see if the column is used. Run the following select
SELECT A.Object_type,
A.Object_name,
A.owner view_owner,
B.Owner,
B.Object_type,
B.Object_name,
B.Object_id,
B.Status
FROM Sys.Dba_objects A,
Sys.Dba_objects B,
( SELECT Object_id, Referenced_object_id
FROM Public_dependency
START WITH Object_id IN (SELECT Object_id
FROM Sys.Dba_objects
WHERE Object_type = 'VIEW')
CONNECT BY PRIOR Referenced_object_id = Object_id) C
WHERE A.Object_id = C.Object_id
AND B.Object_id = C.Referenced_object_id
AND B.owner = 'MY_SCHEMA'
AND B.OBJECT_NAME = 'MY_TABLE'
AND A.Object_type = 'VIEW'
AND A.Owner NOT IN ('SYS', 'SYSTEM')
AND A.Object_name <> 'DUAL'
AND B.Object_name <> 'DUAL';
To see the source for the view type IN SQL*PLUS
SET LONG 32767
SET LONGC 100
SET PAGESIZE 0
SELECT TEXT
FROM ALL_VIEWS
WHERE VIEW_NAME = 'MY_VIEW'
AND OWNER = 'MY_SCHEMA';
Bill
Lead Application Developer
New York State, USA