table t1,t2; ttsbegin; while select t1 { select forupdate t2 where t2.recid == t1.RecId; ..... t2.update(); } ttscommit;