I'm creating an index on a view using Oracle 9.2.0. I get the error ORA-01702 (a view is not appropriate here)...
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.
There really is no good reason that I have come across to create an index on a view, even if it were possible. A view is nothing more than a stored SQL statement. When you query the view, Oracle merges the view's underlying SQL with your SQL and produces a result. If you are having performance problems when querying from the view, then consider tuning the view's SQL statement. This may mean an index needs to be placed on the view's base table, but not the view itself.
Also consider that the view does not store data anywhere. Every time you query the view, the base table is queried. Since the view does not store the data anywhere (it's already in the table), there is nothing to index!
Dig Deeper on Oracle and SQL
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.