39

What is the Query for list the column names for user created views in Oracle?

Prince John Wesley
  • 62,492
  • 12
  • 87
  • 94
Navaneethan
  • 2,125
  • 6
  • 22
  • 32

3 Answers3

40
SELECT
      table_name,
      column_name,
      data_type
 FROM all_tab_columns
WHERE table_name = 'VIEWNAME'
  AND owner      = 'OWNER'
ORDER BY column_id

You can also use USER_TAB_COLUMNS and/or DBA_TAB_COLUMNS depending on your privileges and whether you have permission to query the view.

Justin Cave
  • 227,342
  • 24
  • 367
  • 384
8
SELECT
    *
FROM
    ALL_TAB_COLUMNS
WHERE
    TABLE_NAME = 'your_view_name'
Geo
  • 12,666
  • 4
  • 40
  • 55
2
SELECT table_name, column_name, data_type, data_length
FROM USER_TAB_COLUMNS
WHERE table_name = 'MYTABLE'
rahularyansharma
  • 11,156
  • 18
  • 79
  • 135