Determine underlying tables in a view

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sporge

    Determine underlying tables in a view

    Hi All

    Is there any way to determine what the underlying tables are in a view
    from within a stored procedure?

    I've written a function that parses the View text but I was hoping for
    something more elegant.

    Any help in this regard would be appreciated.
    Ron
  • Minesh

    #2
    Re: Determine underlying tables in a view

    Hi Ron,

    You can use the following query to find out whicc tables your view is
    dependent on

    select name , type , referenced_name , referenced_type
    from user_dependenci es where name = 'VIEW_NAME' and type = 'VIEW' and
    referenced_type = 'TABLE'

    I hope this helps

    Thanks

    Minesh

    RonGeorge@hotma il.com (Sporge) wrote in message news:<7e3b24c7. 0405092346.799f a0e0@posting.go ogle.com>...
    Hi All
    >
    Is there any way to determine what the underlying tables are in a view
    from within a stored procedure?
    >
    I've written a function that parses the View text but I was hoping for
    something more elegant.
    >
    Any help in this regard would be appreciated.
    Ron

    Comment

    • Sporge

      #3
      Re: Determine underlying tables in a view

      Hi Minesh

      Thanks for the help.

      Regards,
      Ron

      Comment

      Working...