select * from all_tab_cols;
Thanks for the reply.
But i don't want all columns, i want columns from the specific table only.
SELECT owner, column_name FROM all_tab_columns WHERE table_name = 'YOUR_TABLE_HERE' ORDER BY owner, table_name;
You may wnat to add "AND owner =..." as the above query will return all tables/views that have the table_name 'YOUR_TABLE_HERE'. i.e. more than one owner can have a table/view of the same name.
... and yes, ALL_TAB_COLUMNS also contains views...
1 person found this helpful
unless you are really looking for a table name in lower case then it doesn't exist. If how ever you are looking for ENER, then search for ENER
WHERE table_name = 'ENER';
...and don't forget you need to do something about owner. i.e. "SELECT owner, column_name"... or use the "WHERE owner = ...' predicate so you know who's object you are dealing with.
Thank you very much Gaz in Oz,
its work like a champ...
Also note there is
USER_TAB_COLUMNS will contain just the user you are logged into tables and views. This view doesn't contain the OWNER column, as that is implcit to the user you are logged in as.
ALL_TAB_COLUMNS contains all the tables/views the you are logged into has access to. This view also contains the OWNER column.
DBA_TAB_COLUMNS contains all the tables and views in the db. This view also contains the OWNER column.
Out of courtesy, if you have got your answer, please mark a post as CORRECT, it will help others see this thread answered your question.
...and as this is a SQL question, you should really have posted in