Query columns names from a table from another user

不羁岁月 提交于 2019-11-27 07:48:32

问题


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!


回答1:


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

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



来源:https://stackoverflow.com/questions/10938145/query-columns-names-from-a-table-from-another-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!