Q

ORA-01702: a view is not appropriate here

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).

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)

.

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!

This was first published in February 2007

Dig deeper on Oracle and SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close