Home » SQL & PL/SQL » SQL & PL/SQL » View
View [message #21379] Tue, 30 July 2002 21:12 Go to next message
Gopal Raw
Messages: 19
Registered: January 2002
Junior Member
I have a view. I want to know the name of table name upon which i have created a view.
Re: View [message #21380 is a reply to message #21379] Tue, 30 July 2002 22:18 Go to previous messageGo to next message
Vikas Gupta
Messages: 115
Registered: February 2002
Senior Member
Hello,

You can run this query to view the SQL statement
for the view and find out which tables it uses.

select view_name, text from user_views;

Regards.
Re: View [message #21385 is a reply to message #21379] Wed, 31 July 2002 09:01 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
You can alaso try a query like this:
select  a.object_type, a.object_name,
  b.owner ref_owner, b.object_type ref_object_type, b.object_name ref_object_name
from  DBA_OBJECTS a, DBA_OBJECTS b,
(select object_id, referenced_object_id
  FROM PUBLIC_DEPENDENCY
  start with object_id = (select object_id
  from DBA_OBJECTS
  WHERE owner        = 'SCOTT'
  AND   object_name  = 'EMP_VIEW'
  AND   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 a.owner <> 'SYS' 
 and a.owner  <> 'DUAL' 
 and a.owner  <> 'SYSTEM' 
 and b.owner <> 'SYS' 
 and b.owner  <> 'DUAL' 
 and b.owner  <> 'SYSTEM' 
Previous Topic: SQL query - count
Next Topic: Re: SQL*Plus
Goto Forum:
  


Current Time: Thu Apr 25 02:15:49 CDT 2024