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 -> Maintaining Stock Availibility : physical table or materialized view ?

Maintaining Stock Availibility : physical table or materialized view ?

From: <krislioe_at_gmail.com>
Date: 6 Sep 2006 17:10:08 -0700
Message-ID: <1157587807.950413.162590@p79g2000cwp.googlegroups.com>


Hi All,
We have typical Order processing application where I should maintain stock availibility => Order is rejected if Stock is not available. The number of orders is 1000 perday, 22 branch, using VPD. 10 users each branch.

We are really tempted to use JUST view /materialized view to maintain stock position.
(where traditionally we use a phiysical table for this, updated after insert/update/delete of transactions)

So the view will be like this :

Create View Stock AS
Select Prod.Code, Prod.beginning_balance,

( SELECT Sum (Qty) from Purchase Where ProdCode = prod.code
...) AS Purchase,

( SELECT Sum (Qty) from Order Where ProdCode = prod.code ...)
AS Order,

         ........
         From Products Prod

So to get the stock availability for a particular product : Select Beginning_balance + Purchase - Order from Stock Where Code = ...

Please give comments, will this work with good performance ? Or has anybody done like this in their application ?

Thank you for your help,
xtanto Received on Wed Sep 06 2006 - 19:10:08 CDT

Original text of this message

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