Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

updateable views - Oracle docs seems wrong

OracleGuy777Jan 5 2009 — edited Jan 6 2009
The docs say:

Note: Updateable views can not include:

- Set Operators (INTERSECT, MINUS, UNION, UNION ALL)
- DISTINCT
- Group Aggregate Functions (AVG, COUNT, MAX, MIN, SUM, etc.)
- GROUP BY Clause
- ORDER BY Clause
- CONNECT BY Clause
- START WITH Clause
- Collection Expression In A Select List
- Subquery In A Select List
- Join Query

I did the following:

dev05 > create table baseTable (name varchar(20));

Table created.

dev05 > insert into baseTable values('Scott');

1 row created.

dev05 > create view testView as (select distinct name from baseTable);

View created.

dev05 > insert into baseTable values ('Scott');

1 row created.

dev05 > insert into baseTable values ('Tiger');

1 row created.

dev05 > select * from baseTable;

NAME
--------------------
Scott
Scott
Tiger

dev05 > update testView set name='Scottie' where name='Scott';
update testView set name='Scottie' where name='Scott'
*
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view


As we can see, when a distinct is used to create the view, we cannot update, BUT, we can clearly insert!

Someone please clarify.

thanks
This post has been answered by BluShadow on Jan 5 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2009
Added on Jan 5 2009
8 comments
4,329 views