while ( @columns = $sth1->fetchrow_array ) { $inserted += $sth2->execute(@columns); ... } }