Scenario: Sometime you have to use InMemory table buffer to apply some logic within the same buffer.
Solution: The solution is to use the sameTable variable by using SetTempData
//local variable
TempTable localTempTable;
;
// set the data to the local tmp table from the original tmp table
localTempTable.setTmpData(originalTmpTable);
ttsbegin;
while select forupdate localTempTable //where localTempTable.somecoindtion ==
{
localTempTable.someField = ”;
localTempTable.update();
}
ttscommit;
//at the end after completing the loop set the tmp data back to the original tmp data
originalTmpTable.setTmpData(localTempTable);