MOVE - repositioning a cursor

SYNOPSIS

 

MOVE [ direction { FROM | IN } ] cursorname

DESCRIPTION Description

MOVE reposition a cursor without retrieving data. MOVE ALL Move the cursor to the end. MOVE works like the FETCH command, but only relocated the cursor does not return rows.


 Refer to the FETCH [ FETCH (. 7)] for details command syntax and parameter.

OUTPUTS Output


 Upon successful completion, MOVE command returns a command tag of the form below

 

MOVE count

count is the number of rows moved (which may be zero).

EXAMPLES Examples

Set up and use a cursor:

 

BEGIN WORK;
DECLARE liahona CURSOR FOR SELECT * FROM films;

- 5 at the beginning of the line is ignored:
MOVE FORWARD 5 IN liahona;
MOVE 5

- the sixth row in the fetch cursor liahona:
FETCH 1 FROM liahona;
 code  | title  | did | date_prod  |  kind  |  len
-------+--------+-----+------------+--------+-------
 P_303 | 48 Hrs | 103 | 1982-10-22 | Action | 01:37
(1 row)

- Close the cursor liahona and submit work:
CLOSE liahona;
COMMIT WORK;

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11089481.html