Satish Buddhala
Satish Buddhala

Reputation: 1

How we can know what views are existed in particular table

In Oracle there is table named customers. If we want to know what views depend on the customer table how can we find that out?

Upvotes: 0

Views: 53

Answers (1)

crammers
crammers

Reputation: 26

You could query the sys.all_dependancies object. This will output the referencing object which is the name of the view using the table specified

SELECT referenced_owner || '.' || referenced_name as table_name,
       referenced_type as type,
       owner || '.' || name as referencing_object,
       type as referencing_type
  FROM sys.all_dependencies
 WHERE referenced_type = 'VIEW'
   AND referenced_name = 'customers' -- put your table/view name here

Upvotes: 1

Related Questions