D
David Grant
How can I make the following query read-write instead of read-only?
SELECT LocMatrix.L1.LocationID, LocMatrix.L2.LocationID, Distance
FROM ((SELECT L1.LocationID, L2.LocationID
FROM tblLocation AS L1, tblLocation AS L2
ORDER BY L1.LocationID, L2.LocationID) AS LocMatrix) LEFT JOIN
tblDistanceMatrix ON (LocMatrix.L1.LocationID =
tblDistanceMatrix.fromLocationID AND LocMatrix.L2.LocationID =
tblDistanceMatrix.toLocationID);
The subquery (shown below) is read-only which is the underlying problem:
SELECT L1.LocationID, L2.LocationID
FROM tblLocation AS L1, tblLocation AS L2
ORDER BY L1.LocationID, L2.LocationID
The above subquery returns every permutation of to and from locationID.
tblDistanceMatrix contains a record only for to/from location pairs for
which a distance has been entered.
When a locationID is added to tblLocation, a simple requery is all that
should be needed for the user to see new location permutations without loss
of existing distance data. Cascade Delete Related Records ensures necessary
records are deleted in tblDistanceMatrix when locationIDs are deleted in
tblLocation.
Any help is appreciated. Thanks,
David
SELECT LocMatrix.L1.LocationID, LocMatrix.L2.LocationID, Distance
FROM ((SELECT L1.LocationID, L2.LocationID
FROM tblLocation AS L1, tblLocation AS L2
ORDER BY L1.LocationID, L2.LocationID) AS LocMatrix) LEFT JOIN
tblDistanceMatrix ON (LocMatrix.L1.LocationID =
tblDistanceMatrix.fromLocationID AND LocMatrix.L2.LocationID =
tblDistanceMatrix.toLocationID);
The subquery (shown below) is read-only which is the underlying problem:
SELECT L1.LocationID, L2.LocationID
FROM tblLocation AS L1, tblLocation AS L2
ORDER BY L1.LocationID, L2.LocationID
The above subquery returns every permutation of to and from locationID.
tblDistanceMatrix contains a record only for to/from location pairs for
which a distance has been entered.
When a locationID is added to tblLocation, a simple requery is all that
should be needed for the user to see new location permutations without loss
of existing distance data. Cascade Delete Related Records ensures necessary
records are deleted in tblDistanceMatrix when locationIDs are deleted in
tblLocation.
Any help is appreciated. Thanks,
David