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 -> Re: delete from a view

Re: delete from a view

From: Serge Rielau <srielau_at_ca.eye-be-em.com>
Date: Thu, 29 Apr 2004 12:49:26 -0400
Message-ID: <c6rbn6$5u8$1@hanover.torolab.ibm.com>


Frederic,

So each table in the UNION ALL is a another subtype in the same hierarchy and the view is just merging them together again? I'm quite certain that Oracle supports subtables. You shouldn't need that view.
Simply create a table hierarchy and then select "inclusive" from the root table.

Here's how it looks in standard SQL (you may need to adjust to Oracle dialect):
CREATE TABLE root OF root_t .....
CREATE TABLE sub1 OF sub1 UNDER root_t .... CREATE TABLE sub2 OF sub2 UNDER root_2 ...

SELECT * FROM root
=> returns all rows in root, sub1 and sub2

SELECT * FROM ONLY(root)
=> returns only rows in root

SELECT * FROM sub1;
=> returns all rows from sub1 and its subtables

Cheers
Serge

-- 
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Received on Thu Apr 29 2004 - 11:49:26 CDT

Original text of this message

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