Using a cursor

 

When SQL runs a SELECT statement, the resulting rows comprise the result table. A cursor provides a way to access a result table.

It is used within an SQL program to maintain a position in the result table. SQL uses a cursor to work with the rows in the result table and to make them available to your program. Your program can have several cursors, although each must have a unique name.

Statements related to using a cursor include the following:

 

Parent topic:

Using SQL in different environments

 

Related reference


Updating data as it is retrieved from a table
CLOSE
DECLARE CURSOR
DELETE
FETCH
UPDATE