MOVE 中文man页面

系统
MOVE 在不检索数据的情况下重新定位一个游标。 MOVE ALL 把游标移动到结尾。 MOVE 的工作类似于 FETCH 命令, 但只是重定位游标而不返回行。

NAME

MOVE - 重定位一个游标

SYNOPSIS

MOVE [ direction { FROM | IN } ] cursorname

DESCRIPTION 描述

MOVE 在不检索数据的情况下重新定位一个游标。 MOVE ALL 把游标移动到结尾。 MOVE 的工作类似于 FETCH 命令, 但只是重定位游标而不返回行。


 请参考 FETCH [fetch(7)] 命令获取语法和参数的详细信息。  

OUTPUTS 输出


 成功完成时,MOVE 命令返回一个下面形式的命令标签

MOVE count

count 是移动的行数(可能为零)。  

EXAMPLES 例子

设置和使用一个游标:

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

-- 忽略开头 5 行:
MOVE FORWARD 5 IN liahona;
MOVE 5

-- 抓取游标 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)

-- 关闭游标 liahona 并提交工作:
CLOSE liahona;
COMMIT WORK;

#p#

NAME

MOVE - position a cursor

SYNOPSIS

MOVE [ direction { FROM | IN } ] cursorname

DESCRIPTION

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

Refer to FETCH [fetch(7)] for details on syntax and usage.  

OUTPUTS

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

MOVE count

The count is the number of rows moved over (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;

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-16 10:59:16

pwconv中文man

2011-08-25 17:43:07

snprintf中文man

2011-08-19 18:30:52

ipc中文man

2011-08-25 17:18:07

putc中文man

2011-08-15 13:53:19

stat中文man

2011-08-25 15:24:31

execlp中文man

2011-08-15 18:06:07

restore中文man

2011-08-24 17:26:35

reindex中文man

2011-08-15 15:45:04

xpdf中文man

2011-08-24 17:06:42

NOTIFY中文man

2011-08-15 14:42:28

uname中文man

2011-08-15 11:30:37

pwd中文man

2011-08-23 14:24:42

ping中文man

2011-08-15 11:01:45

2011-08-11 16:31:49

biff中文man
点赞
收藏

51CTO技术栈公众号