Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Added record in SQL query uses wrong primary key record
Message
From
01/11/1999 22:28:53
Rex Mahel
Realm Software, Llc
Ohio, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Added record in SQL query uses wrong primary key record
Miscellaneous
Thread ID:
00285258
Message ID:
00285258
Views:
57
All,

I create a view using the following code:

CREATE SQL VIEW "LV_INVENTORYDETAIL" ;
AS ;
SELECT ;
UInvDet.iId, ;
UInvDet.iInventoryId, ;
UInvDet.iInventoryLotId, ;
UinvLot.iInventoryAliasId, ;
UAlias.cName AS cAliasName, ;
UInvLot.iId AS iLotId, ;
UInvLot.cLotNumber, ;
UInvLot.yCostPerDose, ;
UInvLot.dExpiration, ;
UInvDet.iQuantity ;
FROM ;
impact!UInvLot ;
INNER JOIN Impact!UInvDet ;
ON UInvLot.iId = UInvDet.iInventoryLotId ;
INNER JOIN Impact!uAlias ;
ON UAlias.iId = Uinvlot.iInventoryAliasId ;
WHERE ;
UInvDet.iInventoryId = ?vp_iInventoryId


UInvDet = Inventory detail file
UAlias = Item information file
UInvLot = Lot information file.

When I add a new record, I get two calls to NewId(), one for UInvDet.iId and one for iLotId, but they both increment the UInvDet record.

I am trying to update both UInvDet and UInvLot from this view. UInvLot only really needs to be updated when a new lot number is added.

Can I do the view this way?
Is there a better way to create this view?


TIA

Rex
Next
Reply
Map
View

Click here to load this message in the networking platform