Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
If you've ever opened a file using PHP's fopen() function or manipulated an array of data, you used a pointer to perform the task. In the former case, a file pointer is used to denote the present position in the file, and in the latter case, a pointer is used to traverse and perhaps manipulate each array value.
Most databases offer a similar feature for iterating through a result set. Known as a cursor, it allows you to retrieve each row in the set separately and perform multiple operations on that row without worrying about affecting other rows in the set. Why is this useful? Suppose your company offers employees a holiday bonus based on their present salary and commission rates. However, the size of the bonus depends on a variety of factors, with the scale arranged like so: