I am running into one of those ORA-0942 errors when I create a VIEW with embedded views. The SELECT by itself has no problems, but when I create a VIEW based on this SELECT, the view gets created, but when I do a SELECT on this view, I get ORA-0942. We are on ORACLE 9i (Rel 184.108.40.206.0). Could it be a patch issue? We have had similar problems with Create Table As with embedded UNION ALL.
Would very much like to hear from you with a possible solution.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
If the SELECT statement works just fine, but creating a view with this SELECT statement causes the ORA-00942 error, the most likely cause is that the user was granted SELECT privileges on a table (or view) through a role. Executing the SELECT statement will use the object privilege granted through the role. But the view requires the object privilege to be granted directly. Grant the privilege to the user directly and the CREATE VIEW will succeed.