The spool command captures data to a file. A cursor is construct that lets you loop through records one by one.