Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any Suggestion on Cyclic Entity Relationship?!
Message
From
23/03/1998 09:42:25
 
 
To
23/03/1998 09:09:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00085989
Message ID:
00086363
Views:
34
>>>>>>I got most problem if mix all tables in one Form...
>>>>>>Because there relationship are cyclic!!
>>>>>>
>>>>>>Tables:
>>>>>>Customer(Cust_no, ... ) Carry Customer info
>>>>>>Orders(Order_no, ...Cust_no[FK]... ) Carry Each order info
>>>>>>Chooseitem(Order_no,item,....) OrdItems in meaning
>>>>>>Item(ItemKey, ...) Carry item info
>>>>>>Spprice(Cust_no,item, ...)
>>>>>>* Special Price lookup Table for each Customer
>>>>>>
>>>>>>But last table link two tables and form a cyclic relationship....
>>>>>>
>>>>>>                          Spprice>-----------+Item
>>>>>>              _____________\/   +              +
>>>>>>             /                   \________     |
>>>>>>            +                             /\  /|\
>>>>>>     Customer +-------< Orders +-------< Chooseitem
>>>>>>
>>>>>>
>>>>>>As VFP only make One work area, the link on finding will make a loop
>>>>>>and many unexpectly, or empty or multiple will come out on join
>>>>>>table....
>>>>>>
>>>>>>Currently I cut the Spprice Table into another Form to avoid this.
>>>>>>But the problem may happen sometime... ~>.<~
>>>>>>Any suggestion to me?!
>>>>>
>>>>>Don't create cyclic relationships, at least physically.
>>>>
>>>>Of cos, I know... but current Dbase has them...
>>>>It take sometime 5-15mins to find records on printing.... +_+'
>>>
>>>Database (if you mean dbc file) can have persistent relationships only (used for RI triggers). All other relationships (temporary) you may or may not set in Form Designer (DE) or programmatically (SET RELATION). Therefore, just be careful not to set cyclic temporary relationships. If it's really necessary to set this kind of relations for printing (which is probably arguable) then you can just SET RELATION right before REPORT FORM and release them after the printing.
>>
>>Thanks, You are right!
>>But my boss and users ask for:
>>If the order is Normal, display discount per item according to chooseit.Qty
>>and also display the discounted Unitprice and subtotal.
>>----
>>The above are succesful done become I kick the spprice table out!!
>>But Request if The order is Special, i.e. Click on a radio button to another
>>value.
>>the grid to display the 'Expression on Special Price Calculation' and
>>the 'Special Price'. Even allow user to edit or save the new expression if
>>possible....
>>These make great problem as need to check if .NULL. on Outer Join!!
>>and add if possible....
>>

>>Most problem is not change the controlsource value of column but...
>>Check on Joining table and insert row if possible... "_"
>>
>>If single open spprice Table in another form and access it.
>>Of cos, all ok as No need to join the Orders and Chooseit Tables!!
>>

>>Finally, for printing reports, I got most problem on this!!
>>Because I test for many different join on VIEW!!
>>sometime got nothing but sometime got 20 or more duplicate or actually rows!!
>>of cos, time consuming!! Even I can use Select Distinct....
>>
>>

>>Okey, I would ask: May I turn down the boss request as joining problem?!
>>Actually, I think it will be very hard to maintain even success to do it!
>>>~<"
>
>I guess that your boss doesn't care what kind of relationships you gonna employ, and whatever code you gonna use. The same about joining.

^_^" My too, if program do go problem, I only care my salary do not get wrong!!
You too?! ;]
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform