Flashnux

GNU/Linux man pages

Livre :
Expressions régulières,
Syntaxe et mise en oeuvre :

ISBN : 978-2-7460-9712-4
EAN : 9782746097124
(Editions ENI)

GNU/Linux

RedHat 5.2

(Apollo)

fetch(l)


FETCH

FETCH

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
SEE ALSO

NAME

fetch - fetch instance(s) from a cursor

SYNOPSIS

fetch [ (forward | backward) ] [ ( number | all) ] [in cursor_name]

DESCRIPTION

Fetch allows a user to retrieve instances from a cursor named cursor_name. The number of instances retrieved is specified by number. If the number of instances remaining in the cursor is less than number, then only those available are fetched. Substituting the keyword all in place of a number will cause all remaining instances in the cursor to be retrieved. Instances may be fetched in both forward and backward directions. The default direction is forward.

Updating data in a cursor is not supported by Postgres, because mapping cursor updates back to base classes is impossible in general as with view updates. Consequently, users must issue explicit replace commands to update data.

Cursors may only be used inside of transaction blocks marked by begin(l) and commit(l) because the data that they store spans multiple user queries.

EXAMPLE

--
--set up and use a cursor
--
begin work;
declare mycursor cursor for
select * from pg-user;
--
--Fetch all the instances available in the cursor FOO
--
fetch all in FOO;
--
--Fetch 5 instances backward in the cursor FOO
--
fetch backward 5 in FOO;
--
--close
--
close foo;
commit;

SEE ALSO

begin(l), commit(l), close(l), move(l), select(l).



fetch(l)