I think that's what it's called....   For the first time I need to worry 
about a BOM for updating inventory, although there will be very few parts.  
I'll have a separate tiny table as below.   There is an "upper level" part, 
and a list of "component" parts.   Each has a "multiplier" because if you sell 
100 of the upper part, and the component has a multiplier of 2, then you 
need to reduce inventory by 200 of the lower.   So a simple example is the 
following and I know how to do this part:
    Upper Level   Component    Multiplier    Qty I would reduce based on 
sale of 100 pieces of part 100
    100           200          1             100
    100           201          1             100
    100           202          2             200

The client said he has no "components of components", but told me to work 
it into the programming in case it ever happens.  I can't think of a way to 
program to take care of unlimited levels, especially when taking into account 
the multiplier.  In the above example, let's say that component 202 has 
subparts.  The data would look like this:
    Upper Level    Component    Multiplier   Qty I would reduce based on 
sale of 100
    100            200          1            100
    100            201          1            100
    100            202          2            200
    202            300          1            100
    202            301          2            400   (because it's 2 * 200)
    
       
Can I do this with a cursor, again taking into account that the levels 
could continue on?   Anyone have code to share?

Karen


Reply via email to