views:

2193

answers:

2

Hi,

How would one get columns information on table which he doesn't own, but has select granted? This is, without using DESCRIBE table_name. Consider this example:


// user bob owns table STUDENTS
grant select on students to josh;
// now josh logs in, normally he would do
describe bob.students;
// but he's looking for something along the lines
select column_name from user_tab_columns where table_name = 'STUDENTS';
// which doesn't work, as josh doesn't own any tables on his own

Any ideas? Is this even doable?

+4  A: 
select column_name from all_tab_columns where table_name = 'STUDENTS';

edit: or better

select owner, column_name from all_tab_columns where table_name = 'STUDENTS';

tuinstoel
+3  A: 

Have a look on oracle data dictionary, it should help.

Aif
Very resourcefull link, thank you!