Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any Suggestion on Cyclic Entity Relationship?!
Message
From
26/03/1998 20:35:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00085989
Message ID:
00087523
Views:
55
>
>*** Orders.Cust_id = Customer.Cust_id AND
>Orderline.itemkey = Spprice.itemkey AND
>Spprice.Cust_id = Orders.Cust_id AND
>Orderline.itemkey = item.itemkey
>
>
>The marked join is redundant because if the oderline is related to the order and the order is related to the customer and the order line is relateed to the spprice then there is no need to relate the spprice to teh cutsomer, so you can present this join as;
>
>
> Customer.Cust_id = Orders.Order_id AND
> Orders.Order_id = OrderLines.Order_id AND
> OrderLine.Item_id = Items.Item_id AND
> OrderLine.Spprice_id = spprice.Spprice_id
>
>
>I still say that NOT storing the price in the Order_lines at the time the order is placed is going to cause big problems later on.


Of cos, Orderline should not have price column, hard to manage in security
reason and also duplicate on price column.
But the special price really need lookup on it! Who(Customer)+Which(Itemkey)!!

>
>Spprice should only be involved for establishing the price at the time of the order, once the order has been made the price should be fixed in the orderlines table.

Well, how I create a new Primary Key to Spprice and make sure non-missmatch on
price lookup!?

make compound key spprice_id == Alltrim(Cust_id)+[$]+alltrim(itemKey) ?!
then, leave two cust_id, itemkey in spprice but generate the spprice_id when
add new!?

Actually, there are two different processes.
Add New Spprice will cause Spprice link to customer and item
but Lookup price in Order form will cause Orderline link to Spprice

Maybe I need to disable the user to use multi-form or do:
set relation when form.Activate but set relation off when form.deactivate....

!_!" Of cos, Make My afraid on it...

````Just like a joker to play 3 balls in 2 hands````
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