What is the Query for list the column names for user created views in Oracle?
Asked
Active
Viewed 9.9k times
39
-
http://stackoverflow.com/questions/452464/how-can-i-get-column-names-from-a-table – rahularyansharma Oct 21 '11 at 04:39
3 Answers
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
-
5Below query worked fine SELECT TABLE_NAME, COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE TABLE_NAME LIKE 'View Name' – Navaneethan Oct 21 '11 at 05:35
-
This also works for materialized views, is it worth to mention it in the answer? – mcvkr Aug 28 '17 at 20:56
2
SELECT table_name, column_name, data_type, data_length
FROM USER_TAB_COLUMNS
WHERE table_name = 'MYTABLE'

rahularyansharma
- 11,156
- 18
- 79
- 135