如何在 SYNONYMS 中获取 Oracle 中的所有列

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3088991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 20:52:48  来源:igfitidea点击:

How to get all columns in Oracle in SYNONYMS

oracleviews

提问by jason

I know how to get all columns in oracle.

我知道如何获取 oracle 中的所有列。

select * from all_tab_columns

but how can I get all columns from SYNONYMSas well?

但是我怎样才能从中获取所有列SYNONYMS

Is this possible to do in oracle?

这可以在oracle中做到吗?

回答by DCookie

Isn't that a bit redundant? If you can see the table a synonym points to, then selecting from all_tab_columns gets you what you want.

是不是有点多余?如果您可以看到同义词指向的表,那么从 all_tab_columns 中选择即可获得您想要的结果。

You can get any synonyms for tables you can see thusly:

你可以得到任何你可以看到的表的同义词:

SELECT atc.*, s.synonym_name
  FROM all_tab_columns atc LEFT JOIN all_synonyms s 
       ON (atc.owner = s.table_owner AND atc.table_name = s.table_name)
 ORDER BY atc.owner, atc.table_name;