ORA-00942 table or view does not exist when querying a view
46001Jul 13 2011 — edited Jul 15 2011I worked on the following problem for few days without finding an answer. Maybe some of you will. Here it is:
There is a view V1 owned by schema X. That view refers to three tables in the same schema (without prefix). Let's say:
Create or replace view X.V1 as
select blablabla...
from T1
where col in (select col from T2 union select col from T3)
T1, T2 and T3 belongs to the same schema X.
Well, if I query the view from a DBA account:
select * from X.V1;
I get the ORA-00942. Even with the SYS account I get the same error.
However, if I create private synonyms (in the DBA account) for table T2 and T3, the query works fine. I don't need synonym for table T1. It seems that name resolution does not look for objects T2 and T3 in the X schema.
There are several views in my "X" schema that have the same behavior. I tried to build a case test with a newly created schema (and fictive tables), but the problem does not reproduce. So I have no clue what's happening with views in schema X.
Anybody has an idea? Thanks.