General information
Category:
The Mere Mortals Framework
Title:
Added record in SQL query uses wrong primary key record
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only