Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Probably an easy question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00501861
Message ID:
00502065
Vues:
18
>Hello,
>
>I am brand new to VFP, so this question is probably a very easy one. I am using VFP 6.0 with Stonefield and MMF.
>
>I have a large database containing many large tables. One of these tables contains several thousand customer orders, another contains a listing of all the possible products a customer can order, as well as all of the components needed to build each product. For example - Product A contains components 1, 3, 6, and 7; Product B contains componenents 1, 2, and 3.
>
>I need help writing a method that would pull all products containing a particular component and replace that component with a new one for all existing and future orders. For example - Using the data above, if component 2 was to be replaced with component 4, any future orders for product B would contain components 1, 3, and 4.
>
>I apologize if this seems real easy to you, but I am just starting out in VFP and could use any help you VFP Gurus could offer me!
>
>-Justin

Without knowing much about your app, the best way to do it (well, IMHO) is to have a separate table that links products and components. The table would have two fields, one for product ID, the other for component ID; this way, you can have an unlimited number of components for any product. Then, when you are building your order, you would get the product ID, query against the link table for your list of components. You could also add a date field (or start and end dates) to the link table to allow for a specific switchover date or time frames for a given component.

Just one idea...
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform