Tabele użyte do utworzenia widoku można wybrać za pomocą zapytania:
select
name ,
type ,
referenced_name ,
referenced_type
from
user_dependencies
where
name = 'VIEW_NAME' and
type = 'VIEW' and
referenced_type = 'TABLE';
Jeśli kolumny widoku mają tę samą nazwę kolumny tabeli, wypróbuj poniższe zapytanie:
select
distinct table_name, column_name
from
all_tab_columns
where table_name in (select
referenced_name
from
user_dependencies
where
name = 'VIEW_NAME' and
type = 'VIEW' and
referenced_type = 'TABLE')
and column_name in (select
column_name
from
all_tab_columns
where
table_name = 'VIEW_NAME');