Skip to Main Content
  • Questions
  • Column view definition in data dictionary

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Dusan.

Asked: July 12, 2016 - 10:39 am UTC

Last updated: July 12, 2016 - 12:42 pm UTC

Version: 11.2.0.4

Viewed 1000+ times

You Asked

Hello there,

Is it possible to get view column definition from data dictionary?
I mean something similar as for tables - user_tab_columns.

Thanks,

Dusan

and Chris said...

If you look in user_tab_columns, you'll find views are in there too!

create table t (
  x int not null,
  y date
);

create or replace view v as 
  select * from t;
 
select column_name, data_type, column_id, nullable
from user_tab_columns
where  table_name = 'V';

COLUMN_NAME  DATA_TYPE  COLUMN_ID  NULLABLE  
X            NUMBER     1          N         
Y            DATE       2          Y

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

I stacked with V$ views, but now I see

Dusan Valasek, July 12, 2016 - 1:27 pm UTC

I knew about that, but I was wondering why

select * from DBA_TAB_COLUMNS where table_name='V$SQL';

is not giving me an output.

Just forgot that V$SQL is a synonym for V_$SQL

select * from DBA_TAB_COLUMNS where table_name='V_$SQL';

this works ok!

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library