Hi,
[ Update labtests set labtests.testid = mTestID ]
You it did not inform the Where, then all the target will be all. Best in this in case that, it would be to change for:
replace labtests.testid with mTestID in labtests
Therefore the target is the current, different of update that he is all.
Cordialmente,
Fabiano Costa