| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: delete cascade
paul c wrote:
> paul c wrote:
>
>> Bob Badour wrote: >> >>> ... >>> More and more, I am liking "on delete" or "on update" less and less. >>> I suggest the appropriate place to handle the issue is in the view >>> specification. If one wants "on delete cascase", one can present a >>> view with the invoice items as an RVA. >>> ... >> >> That is intriguing about RVA's. Do you have in mind entwining the >> notion of an invoice transaction with a reference constraint by not >> assigning the rva until it is known (by some program) that all items >> have been inserted (into some table or other)?
Consider base relations you would likely find familiar with an Invoice relation, an InvoiceItem relation, and a foreign key reference from InvoiceItem to Invoice.
In the first case, consider application views that essentially mirror the base relations. If someone tries to delete an invoice while invoice items remain, the dbms will balk with an error due to the foreign key constraint.
In a second case, consider an application view that groups the invoice items as an RVA of each invoice. If one deletes an invoice, one deletes the invoice items at the same time and the dbms will not balk.
In a third case, consider an application view that exposes only the invoice and not the items: The "on delete cascade" trigger would allow one to delete the invoice and the invoice items without ever knowing about the items. Can one devise a view that would achieve the same effect?
Would it suffice to declare the view using the RVA as above and then project away the RVA? Received on Sun Apr 22 2007 - 07:47:35 CDT
![]() |
![]() |