all_tab_columns and all_tab_cols
715840Aug 5 2009 — edited Aug 5 2009Hey guys,
I've come across this problem, what can I do? I know what all_tab_cols and all_tab_columns are supposed to have information about all the tables in the database and that they're very useful.
The problem is, all_tab_cols will show that a certain tables exists, or that a certain column belongs to a table. When I try to query that table directly I get a message saying the table or column don't exist.
For example,
If I execute the following:
select table_name, column_name from all_tab_cols
where owner='ME' and table_name = 'THE_TABLE_I_WANT'
then I get this response:
table_name - column_name
THE_TABLE_I_WANT - first_column
THE_TABLE_I_WANT - second_column
THE_TABLE_I_WANT - third_column
Then suppose I do the following:
select first_column from THE_TABLE_I_WANT
An error shows up saying that the column doesn't exist.
This happens with whole tables as well, where the table will show up in the all_tab_columns table but can't be queried directly with a select *.
What can cause this and how can I get accurate information from all_tab_columns/all_tab_cols??