Getting and processing a result set