1MOVE() SQL Commands MOVE()
2
3
4
6 MOVE - position a cursor
7
8
10 MOVE [ direction { FROM | IN } ] cursorname
11
12
14 MOVE repositions a cursor without retrieving any data. MOVE works
15 exactly like the FETCH command, except it only positions the cursor and
16 does not return rows.
17
18 Refer to FETCH [fetch(7)] for details on syntax and usage.
19
21 On successful completion, a MOVE command returns a command tag of the
22 form
23
24 MOVE count
25
26 The count is the number of rows that a FETCH command with the same
27 parameters would have returned (possibly zero).
28
30 BEGIN WORK;
31 DECLARE liahona CURSOR FOR SELECT * FROM films;
32
33 -- Skip the first 5 rows:
34 MOVE FORWARD 5 IN liahona;
35 MOVE 5
36
37 -- Fetch the 6th row from the cursor liahona:
38 FETCH 1 FROM liahona;
39 code | title | did | date_prod | kind | len
40 -------+--------+-----+------------+--------+-------
41 P_303 | 48 Hrs | 103 | 1982-10-22 | Action | 01:37
42 (1 row)
43
44 -- Close the cursor liahona and end the transaction:
45 CLOSE liahona;
46 COMMIT WORK;
47
48
50 There is no MOVE statement in the SQL standard.
51
53 CLOSE [close(7)], DECLARE [declare(l)], FETCH [fetch(l)]
54
55
56
57SQL - Language Statements 2008-06-08 MOVE()