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

Re: Maintaining Stock Availibility : physical table or materialized view ?

From: <krislioe_at_gmail.com>
Date: 7 Sep 2006 05:44:42 -0700
Message-ID: <1157633082.836378.221730@i42g2000cwa.googlegroups.com>


Hi,
Thanks for your response.

> I fail to see what it is you think a materialized view will do that
> a column named QTY_ON_HAND won't.

I come from developer perspective, we have number of transactions that could add/subtract the stock, by giving the job to Oracle query via View, we try to avoid the problems/bugs that could exist in our code when updating the stock.

And we are hoping that the STock_Availability view will always show the correct/up to date value, with minimal coding effort.

Is this a wrong reason ?

Thanks,
xtanto

DA Morgan wrote:
> krislioe_at_gmail.com wrote:
> > 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

>

> I fail to see what it is you think a materialized view will do that
> a column named QTY_ON_HAND won't.
>

> With only 1,000 tx per day a simple update should be invisible to
> end users.
> --
> Puget Sound Oracle Users Group
Received on Thu Sep 07 2006 - 07:44:42 CDT

Original text of this message

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