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!

Dig Deeper on Oracle development languages

Data Management
Business Analytics
SearchSAP
TheServerSide.com
  • Why WebAssembly? Top 11 Wasm benefits

    Latency and lag time plague web applications that run JavaScript in the browser. Here are 11 reasons why WebAssembly has the ...

  • Why Java in 2023?

    Has there ever been a better time to be a Java programmer? From new Spring releases to active JUGs, the Java platform is ...

  • How developers can avoid remote work scams

    Software developers can find good remote programming jobs, but some job offers are too good to be true. Follow these tips to spot...

Data Center
Content Management
HRSoftware
Close