4 Replies Latest reply on Feb 23, 2013 5:29 AM by Nitesh.

    Help

    684487
      Hi all experts,

      I have a view name ROVAY13 and i would like to know which table this view is related to. Can you provide the sql statement to do it? I will appreciate it
        • 1. Re: Help
          sb92075
          user10890048 wrote:
          Hi all experts,

          I have a view name ROVAY13 and i would like to know which table this view is related to. Can you provide the sql statement to do it? I will appreciate it
          select text from all_views where view_name = 'ROVAY13';
          • 2. Re: Help
            Frank Kulash
            Hi,

            You can also query the data dictionary view ALL_DEPENDENCIES:
            SELECT  *
            FROM    all_dependencies
            WHERE   owner   = 'SCHEMA_NAME'
            AND     name    = 'ROVAY13'
            ;
            • 3. Re: Help
              Nitesh.
              If u want to check tables related to views in your schema alone then better go with this query

              SELECT *
              FROM user_dependencies
              WHERE NAME = 'ROVAY13 ';

              or else if u want to check to also understand as how the tables are mapped to the views then try this way

              SELECT *
              FROM user_views
              WHERE view_name = ''ROVAY13 '; -- This will also show the text in which you can see SQL query in which related tables will be clearly seen as how and which columns are mapped ..

              Try it and let know ..

              Rgds,
              Nitkhush..
              • 4. Re: Help
                Nitesh.
                If u want to check tables related to views in your schema alone then better go with this query

                SELECT *
                FROM user_dependencies
                WHERE NAME = 'ROVAY13';

                or else if u want to check to also understand as how the tables are mapped to the views then try this way

                SELECT *
                FROM user_views
                WHERE view_name = 'ROVAY13'; -- This will also show the text in which you can see SQL query in which related tables will be clearly seen as how and which columns are mapped ..

                Try it and let know ..

                Rgds,
                Nitkhush..