tags:

views:

31

answers:

1

I know how to get all columns in oracle.

select * from all_tab_columns

but how can I get all columns from SYNONYMSas well?

Is this possible to do in oracle?

+5  A: 

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.

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;
DCookie