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 188.8.131.52.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 email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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.