tags:

views:

70

answers:

3

I'm trying to make an extremely minor change to a view on an oracle database, but what's confusing me is that the base table/view for the view I want to change doesn't seem to exist.

First I did this:

select text from all_views where view_name='(view name)';

and got the view text, which of course was something like this:

SELECT (fields) FROM (table)

Trying to run this query on its own returns an error saying that this table or view does not exist. Searching through the lists of table names and views on the all_ tables returns nothing. Creating a new view with the same source select statement tells me I can't make it because the table or view doesn't exist. Now, this is a production database, so this should work because I can use the existing view just fine. I don't have much experience with oracle databases, so I'm probably missing something here.

+4  A: 

I'm betting the view is in another schema. Does this return the same as your first query:

select text from all_views where view_name='(view name)' and owner = user;

If that returns no rows, then you need to find the view's owner:

select owner from all_views where view_name = '(view_name)';

And change your SQL to

select (fields) from (view_owner).(table);
Adam Musch
I know the view's owner and tried select (fields) from (view_owner).(table), then was told it still didn't exist. I just can't imagine where or what this table could be.
Chris
You may only have rights to the view, not to the underlying table. Is that owner/table_name combination in `ALL_TABLES`?
Adam Musch
A: 

Wow, nevermind. They weren't even asking me to do this. I missed that part in the original email.

Chris
+1  A: 
kupa