Wednesday, July 22, 2009

ORA-12014 error while creating materialized view

When materialized view is created with REFRESH COMPLETE option and the table for which the view has to be created doesn’t contain any primary keys then an error will be thrown while creating the view.

The error would be ‘ORA-12014 ‘

To overcome this error ‘WITH ROWID’ option should be used along with the refresh option.

Then you can create the materialized view.

CREATE MATERIALIZED VIEW VIEW_NAME
REFRESH COMPLETE ON DEMAND
WITH ROWIDASSELECT * FROM TABLE_NAME

No comments:

Powered By Blogger