Home > Software engineering >  Get column type from materialized view
Get column type from materialized view

Time:10-17

I want to get the column type of a materialized view. I am trying with:

select * from user_tab_columns

and with:

select * from ALL_TAB_COLUMNS

but I don't have how to filter ONLY the materialized views.

CodePudding user response:

One option would be

select col.*
  from user_tab_columns col
 where col.table_name in (select mv.mview_name
                            from user_mviews mv)

If you wanted to query all_tab_columns rather than user_tab_columns, you'd want to use all_mviews and include the owner as well

select col.*
  from all_tab_columns col
 where (col.owner, col.table_name) in (select mv.owner, mv.mview_name
                                         from all_mviews mv)
  • Related