I was wondering whether there is a possibility for me to discover the underlying primary (or unique) key columns for all tables involved in an Oracle view. Here\'s an exampl
SELECT column_name FROM user_ind_columns
WHERE index_name =
(SELECT index_name FROM user_constraints
WHERE constraint_type='P' AND table_name='T_A')
ORDER BY column_position;
If you want to do it for all tables that a view depends on, then change the condition on table_name to something like:
table_name IN (SELECT referenced_name FROM user_dependencies
WHERE name='view_name' AND referenced_type='TABLE')