FETCH with a Sequential Cursor
EXEC SQL FETCH seq_curs INTO :fname, :lname; EXEC SQL FETCH NEXT seq_curs INTO :fname, :lname;
When the program opens a sequential cursor, the database server processes the query to the point of locating or constructing the first row of data. The goal of the database server is to tie up as few resources as possible.
Because the sequential cursor can retrieve only the next row, the database server can frequently create the active set one row at a time.
On each FETCH operation, the database server returns the contents of the current row and locates the next row. This one-row-at-a-time strategy is not possible if the database server must create the entire active set to determine which row is the first row (as would be the case if the SELECT statement included an ORDER BY clause).