7

Sounds pretty easy query the column names from a table, right? Indeed there is a answer to this question How can I get column names from a table in Oracle?

The main issue is that the table belongs to another user. My user is just for integration and I don't have any database privileges.

So I'm able to do some query like: SELECT * FROM anotherUser.THE_TABLE;

But something like SELECT * FROM USER_TAB_COLUMNS return no rows.

Perhaps I can create queries over all_tab_columns, Are there another faster options without procedures?

*It´s a oracle database!

Community
  • 1
  • 1
Custodio
  • 8,594
  • 15
  • 80
  • 115
  • :`user_tab_columns` is a data dictionary that will contains columns of the table ,which belongs to your schema ,not `anotherUser`,if you want try with `all_tab_columns` or dba_tab_columns`.Please have a look to this `http://docs.oracle.com/cd/E11882_01/server.112/e17110/statviews_1001.htm#i1572007` – Gaurav Soni Jun 07 '12 at 19:03

1 Answers1

6
SELECT * 
  FROM ALL_TAB_COLUMNS
 WHERE OWNER='ANOTHERUSER' 
   AND TABLE_NAME='THE_TABLE';

Should get you there if you have privileges on the table.

DCookie
  • 42,630
  • 11
  • 83
  • 92