Joined: 06 Sep 2007 Posts: 788 Location: Chennai, India
Could anyone please give a query for Bill of Materials.
As you have already known,
Bill of materials (BOM) is the term used to describe the "parts list" of components needed to complete a saleable end-item.
BOMs are hierarchical in nature with the top level representing the sub-assembly or end-item. For example the end-item BOM for a Personal computer would list the computer, its major sub-assemblies (board, chassis, modem, keyboard, display, etc.) as well as additional materials needed for a complete saleable product -- shipping box, user manual, packaging, packaging labels, etc.
I Feel that The db2 version is irrelevant in this case...
the design must choose the logic flow,
the DB2 facilities might help to write less code...
Nobody with a reasonable understanding of BOM processing
would base the application development on forum replies,
that' s why I asked if it was homework or not...
Usually ( at least were I was involved in building the teams ) the DB design was done with the help and APPROUVAL of DB support,
and all the relevant queries were modeled and tested by db support before being deployed to the programmers
in this case ( forget about the right syntax, it' s just the concept )
select lev0.pn, lev1.pn, lev2.pn,.... for the number of hardcoded levels from (pn_mastr lev0 ( pn_mast lev1
( I HAD A MODEL TESTED AND WORKING A LOONG TIME AGO, BUT THREW AWAY EVERITHING :-( )
will give the bom exploded view for n levels ...
but this will be only a theoretical query.. even if correct one from a sql point of view
and I would never dream to approach a BOM application in this way
BOM has too many nuances
for the relevant queries to solved by db2 advanced query techniques only