Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
MOVE
Prev UpSQL CommandsHome Next

MOVE

MOVE — position a cursor

Synopsis

MOVE [direction ] [ FROM | IN ]cursor_namewheredirection can be one of:    NEXT    PRIOR    FIRST    LAST    ABSOLUTEcount    RELATIVEcountcount    ALL    FORWARD    FORWARDcount    FORWARD ALL    BACKWARD    BACKWARDcount    BACKWARD ALL

Description

MOVE repositions a cursor without retrieving any data.MOVE works exactly like theFETCH command, except it only positions the cursor and does not return rows.

The parameters for theMOVE command are identical to those of theFETCH command; refer toFETCH for details on syntax and usage.

Outputs

On successful completion, aMOVE command returns a command tag of the form

MOVEcount

Thecount is the number of rows that aFETCH command with the same parameters would have returned (possibly zero).

Examples

BEGIN WORK;DECLARE liahona CURSOR FOR SELECT * FROM films;-- Skip the first 5 rows:MOVE FORWARD 5 IN liahona;MOVE 5-- Fetch the 6th row from the 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 end the transaction:CLOSE liahona;COMMIT WORK;

Compatibility

There is noMOVE statement in the SQL standard.


Prev Up Next
MERGE Home NOTIFY
pdfepub
Go to Postgres Pro Standard 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp