Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can we create Materialized view from view with force and editionable options in oracle?

I am new to oracle. I am using oracle database 19c. I try to create a materialized view from a view. But i get "ORA-00942" error. Does this mean a mview cannot be created from a force editionable view or it is possible to create with any additional privileges? Thanks in advance.

sql>conn kish/password
Connected.
sql>create table ds as select * from dba_source;

Table created.

sql>create or replace force editionable view "dsv" as select * from ds;

View created.

sql>create materialized view dsmv as select * from dsv;
create materialized view dsmv as select * from dsv
                                               *
ERROR at line 1:
ORA-00942: table or view does not exist

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

"dsv" is different from dsv. In Oracle, never use double quotes (unless you have a really, really good reason – and this isn’t one).

Remove double quotes, entirely.

SQL> create view dsv as select * from dept;

View created.

SQL> create materialized view dsmv as select * from dsv;

Materialized view created.

SQL> select * from dsmv;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading