Added SQL statement array for updates, added SQL execution loop