Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Why aren't UNION ALL updatable ?

Why aren't UNION ALL updatable ?

From: <dellera_at_my-deja.com>
Date: Sun, 11 Feb 2001 10:16:18 GMT
Message-ID: <965opg$nkp$1@nnrp1.deja.com>

Dear all,

I was wondering why it's not possible to update a view which is the UNION ALL (please note: UNION ALL, not UNION) of two identical tables:

 SQL> create table pp1 (x number);

 Table created.

 SQL> create table pp2 (x number);

 Table created.

 SQL> create or replace view ppv as

         select * from pp1
      union all
         select * from pp2
      ;

 View created.

 SQL> update ppv set x = 1;
 update ppv set x = 1

         *
 ERROR at line 1:
 ORA-01732: data manipulation operation not legal on this view

IMHO, "update ppv set x = 1;" may be seen equivalent to "update pp1 set x = 1; update pp2 set x = 1;", and so rewritten on the fly by the Oracle engine.

Of course I know that I can use partitioning, and I also know that there is the possibility to use PARTITIONED VIEWS (even if the latter is a deprecated feature); my question is more theoretical, namely if there's any underlying strong reason to avoid this. For instance, I would call this view a key-preserved one ..

Any idea to clear my puzzled mind ?

Thanks in advance
Alberto

Sent via Deja.com
http://www.deja.com/ Received on Sun Feb 11 2001 - 04:16:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US