Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: delete from a view
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 LabReceived on Thu Apr 29 2004 - 11:49:26 CDT