While the example program written for this appendix does not attempt to update the cursor data, it's not that hard to do (though it does expose a much wider set of issuesfodder for another appendix). Suffice it to say that the cursor can be updated through use of the CURRENT OF expression in the UPDATE statement's WHERE clause. For example, to position to a specific row (based on the cursor row, 1 to @@CURSOR_ROWS) and update that row, you could code a routine like the one shown in Figure IV.5. Figure IV.5. Executing the UPDATE statement using the WHERE CURRENT OF option. |