Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: create materialized view
Well I have solved the problem creating the materialized view with
"WITH ROWID" option, so Oracle doesn't complain about pk.
Anyway I wasn't able at all to add the pk to the view:
"CREATE VIEW Emp_view
(id PRIMARY KEY DISABLE NOVALIDATE, firstname)
AS SELECT employee_id, first_name
FROM employees
WHERE department_id = 10;"
In this statement I get "Invalid character" after PRIMARY KEY keyword.
All I could do is adding an Unique constraint link this:
"ALTER VIEW Emp_view
ADD CONSTRAINT emp_view_unq
UNIQUE (first_name) DISABLE NOVALIDATE;"
but adding a primary key constraint doesn't work at all.
The banner of SQLplus says that I have this version of the DB:
"Connected to:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production"
do I have to activate any setting of the DB in order to add a pk on a
view ???
Thanks again
Francesco
Received on Fri Feb 11 2005 - 03:12:19 CST