从另一个用户的表中查询列名 [英] Query columns names from a table from another user

查看:93
本文介绍了从另一个用户的表中查询列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

听起来很容易,可以查询表中的列名,对吗?确实,这个问题有答案如何获取列名是从Oracle中的表中获取的?

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.

所以我能够执行一些查询,例如:SELECT * FROM anotherUser.THE_TABLE;

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

但是类似SELECT * FROM USER_TAB_COLUMNS的东西不会返回任何行.

But something like SELECT * FROM USER_TAB_COLUMNS return no rows.

也许我可以在all_tab_columns上创建查询,没有程序,还有其他更快的选择吗?

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

*这是一个oracle数据库!

*It´s a oracle database!

推荐答案

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

如果您在桌子上有特权,应该带您到那里.

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

这篇关于从另一个用户的表中查询列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆