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: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Thu, 29 Apr 2004 18:58:44 GMT
Message-ID: <40915064.66DF5992@remove_spam.peasland.com>


> In fact, I made the view because I get a uuid, and I don't know of which
> type it is (see first posts for explanation of structure). So, the view
> gather all the tables with good performance. I have the same problem with
> the delete.

If your view looks like the following:

CREATE VIEW my_view AS
SELECT * FROM table1
UNION ALL
SELECT * FROM table2
UNION ALL
SELECT * FROM table;

Then instead of this:

DELETE FROM my_view WHERE uuid='abc123';

why not just issue the following:

DELETE FROM table1 WHERE uuid='abc123';
DELETE FROM table2 WHERE uuid='abc123';
DELETE FROM table3 WHERE uuid='abc123';

It's not as pretty, but it works. Since this is a universal id, one DELETE statement will delete one row and the other delete statements will delete zero rows. Like I said, not pretty, but it works.

Cheers,
Brian

-- 
===================================================================

Brian Peasland
dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Thu Apr 29 2004 - 13:58:44 CDT

Original text of this message

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