Ask the Expert

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

    Requires Free Membership to View

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: