Solved

Received ORA-22818 subquery expressions not allowed here when creating materialized view

Posted on 2006-10-30
3
1,771 Views
Last Modified: 2012-06-21
Hello,

I was trying to create a materialized view to describe the referential integrity among my tables:

create materialized view user_references
   tablespace tbspc
   build immediate
   using index
   refresh complete on demand next sysdate + 1
   as
   select uic.table_name to_table, uic.column_name to_column,
      ucc.table_name from_table, ucc.column_name from_column
      from user_ind_columns uic, user_constraints uc, user_cons_columns ucc
      where uic.index_name = uc.r_constraint_name
      and uc.constraint_name = ucc.constraint_name
      and uc.owner=upper('my_schema');

I was able to create this MV in Oracle  9.2. It failed with the following error when I ran it against Oracle 10.1:

                from user_ind_columns uic, user_constraints uc, user_cons_columns ucc
                     *
ERROR at line 9:
ORA-22818: subquery expressions not allowed here

Is not allowing subqueries in MV a new restriction in Oracle 10? Is there a workaround?

Thanks
0
Comment
Question by:bertchan2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
Tayger earned 50 total points
ID: 17836734
Hello

Your statement looks fine to me.

Try first to get/make sure the following grants before creating the MV:
grant query rewrite to <MV_creation_user>;
alter session set query_rewrite_enabled=true;
alter session set query_rewrite_integrity=enforced;

There is a good link about init.ora parameters for creating MVs:
http://www.akadia.com/services/ora_materialized_views.html

Hope this helps.
Tayger
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question