FetchRelative()

 variable.FetchRelative(offset)

This method is used to fetch the row from the active set which depends on the current cursor position and is either above or below the current cursor position by the specified offset. It can be used only with cursors declared WITH SCROLL.

It accepts one argument which is either a literal integer or an integer variable. It specifies the number of rows the cursor should be moved either upwards or downwards from the current position. This method moves the cursor to the row specified by the offset and retrieves it. The argument can be either positive or negative integer. If the offset is represented by a positive integer (the plus sign is optional), the cursor will be moved down by the specified number of rows. If the offset is represented by a negative integer (in this case the minus sign should be specified explicitly), the cursor will be moved up by the specified number of rows.

If you specify 0 as the argument, this method will function in the same way as FETCH CURRENT statement - it will not move the cursor from the current row and will fetch it again.

CALL cur_v.FetchRelative(-3)

CALL cur_v.FetchRelative(0)