how do you loop a temporary table ?