Query column_name, hidden_column, data_type from DBA_TAB_COLS for a table name : DBA_TAB_COLUMNS « System Tables Views « Oracle PL / SQL






Query column_name, hidden_column, data_type from DBA_TAB_COLS for a table name

 
SQL> create or replace type Job as object (
  2   firstname varchar2(30),
  3   surname varchar2(30),
  4   date_of_birth date,
  5   end_date date,
  6   item_count number(4),
  7   items_retrieved varchar2(1)
  8  )
  9  /

Type created.

SQL> create table Task (
  2   person_id number(10),
  3   job_detail Job
  4  );

Table created.

SQL>
SQL> set long 50000
SQL> select text from dba_views where view_name = 'DBA_TAB_COLUMNS'
  2  /

TEXT
--------------------------------------------------------------------------------
select OWNER, TABLE_NAME,
       COLUMN_NAME, DATA_TYPE, DATA_TYPE_MOD, DATA_TYPE_OWNER,
       DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, COLUMN_ID,
       DEFAULT_LENGTH, DATA_DEFAULT, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE,
       DENSITY, NUM_NULLS, NUM_BUCKETS, LAST_ANALYZED, SAMPLE_SIZE,
       CHARACTER_SET_NAME, CHAR_COL_DECL_LENGTH,
       GLOBAL_STATS, USER_STATS, AVG_COL_LEN, CHAR_LENGTH, CHAR_USED,
       V80_FMT_IMAGE, DATA_UPGRADED, HISTOGRAM
  from DBA_TAB_COLS
 where HIDDEN_COLUMN = 'NO'


1 row selected.

SQL> select column_name, hidden_column, data_type from DBA_TAB_COLS where table_name = 'TASK'
  2  /


SQL> drop table Task;

Table dropped.

SQL>

   
  








Related examples in the same category

1.Using the DBA_TAB_COLUMNS View