1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to know a view have How many tables or views?

Discussion in 'SQL PL/SQL' started by jagadekara, Jul 7, 2014.

  1. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi All,

    I just want to know how many tables a view have?

    I mean, i have a view ex: RA_CUST_TRX_LINE_GL_DIST_V
    So I want to know how many tables or views this view consists?

    Is it possible through any query? I don't want to see whole view script...

    Note that this is not requirement, It's just for learning....
     
  2. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Hi Jagadekara,

    There is a table in Oracle which keeps these dependencies:

    Code (SQL):

    SELECT * FROM dba_dependencies WHERE name = 'RA_CUST_TRX_LINE_GL_DIST_V';

    APPS    RA_CUST_TRX_LINE_GL_DIST_V  VIEW    APPS    RA_RULES    SYNONYM     HARD
    APPS    RA_CUST_TRX_LINE_GL_DIST_V  VIEW    APPS    AR_LOOKUPS  VIEW        HARD
    APPS    RA_CUST_TRX_LINE_GL_DIST_V  VIEW    APPS    RA_CUST_TRX_LINE_GL_DIST    SYNONYM     HARD
    APPS    RA_CUST_TRX_LINE_GL_DIST_V  VIEW    APPS    RA_CUSTOMER_TRX_LINES   SYNONYM     HARD

     
    I use this quite often instead of Sh.F4 on the view name to get the details (query) behind the view - it's faster and you get to know the "core" table/view names which we generally use in script (to get the full contents of the core tables, for ex., instead of a partial picture filtered by the view).
     
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    oh! Super Rajen,

    Thanks a lot.
     
  4. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Useful Table Information Rajen.. Quite easy to know the tables behind the view without opening the entire view.