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: Frederic Houbie <fh_at_ionicsoft.comNOSPAAAAM>
Date: Fri, 30 Apr 2004 08:58:45 +0200
Message-Id: <pan.2004.04.30.06.58.43.137411@ionicsoft.comNOSPAAAAM>


On Thu, 29 Apr 2004 18:58:44 +0000, Brian Peasland wrote:

>> 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

Yes, that's what we are doing but it's not very pretty :-) Received on Fri Apr 30 2004 - 01:58:45 CDT

Original text of this message

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