| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Newbie Master-Detail Updates
>> What is the best way to do a Master-Detail Update from code/GUI.
<<
What is the best automobile to buy? It depends....
In this case, we have no idea what your business rules are or anything about the application. You have also worded your vague, general request in non-relational terminology. Let's make it more concrete; orders and order details.
CREATE TABLE Orders
(order_nbr INTEGER NOT NULL PRIMARY KEY,
customer CHAR(30) NOT NULL,
...);
CREATE TABLE OrdersDetails
(order_nbr INTEGER NOT NULL
REFERENCES Orders (order_nbr)
ON DELETE CASCADE
ON UPDATE CASCADE,
REFERENCES Inventory (upc)
ON DELETE CASCADE
ON UPDATE CASCADE,
SELECT order_nbr, upc, SUM(quantity)
FROM WorkingTable
GROUP BY order_nbr, upc
3) Once the two tables are loaded, do you write some stored procedures to handle your options:
UPDATE OrderDetails
SET detail_nbr
I think you have the wrong mental model of SQL. This is not a 1950's file system where you have to over-write the old data, or re-punch cards. Received on Thu Feb 21 2002 - 15:09:43 CST
![]() |
![]() |