Fixed loop for multiple tables