DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Materialized view source columns

  1. #1
    Join Date
    Apr 2006
    Posts
    6

    Materialized view source columns

    Hi to all.
    How can I extract the all source columns of a mview? In the user_mview_keys are presented only the single source columns, but not those who are included in expression. For example:
    CREATE MATERIALIZED VIEW mview1 AS
    SELECT emp_no, d.dname||e.ename FROM dept d INNER JOIN emp e ON (d.deptno=e.deptno)
    So, in this case, in the user_mview_keys we can see only the emp_no field but not the dname and ename fields. Is there a way to extract this information from Oracle data dictionary without parsing the materialized view query? Also, is there a way to extract all columns that are included in the WHERE clause of the materialized view query?
    Any help will be appreciate!

  2. #2
    Join Date
    Apr 2006
    Posts
    50
    Maybe I'm reading this wrong but if you're just after the column names can't you just select them from user_tab_columns?

    e.g.create materialized view testcols as select siteref||sitename from fig.t_jacsite;

    17:02:47 jack@JACL> select column_name from user_tab_columns where table_name = 'TESTCOLS';

    COLUMN_NAME
    ------------------------------
    SITEREF||SITENAME

  3. #3
    Join Date
    Apr 2006
    Posts
    6
    But if you type:
    Beroetz>CREATE MATERIALIZED VIEW TestCols AS
    SELECT SITEREF||SITENAME "Col1" ...
    Then we have:
    Beroetz> select column_name from user_tab_columns where table_name = 'TESTCOLS';
    COLUMN_NAME
    ------------------
    Col1
    So we loose the information about the source columns. Also I'm looking for the columns that participate in the WHERE clause!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width