From 8690ebc26f26b2fe39d22eee8b76cab67a96bc09 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 29 Apr 2007 01:21:09 +0000 Subject: Support for MOVE in PL/PgSQL. Initial patch from Magnus, some improvements by Pavel Stehule, and reviewed by Neil Conway. --- doc/src/sgml/plpgsql.sgml | 56 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 97090b7316d..c1f57ddf4f8 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -1,4 +1,4 @@ - + <application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language @@ -1522,6 +1522,13 @@ GET DIAGNOSTICS integer_var = ROW_COUNT; true if it returns a row, false if no row is returned. + + + A MOVE statement sets FOUND + true if it successfully repositions the cursor, false otherwise. + + + A FOR statement sets FOUND true @@ -2562,6 +2569,53 @@ FETCH curs1 INTO rowvar; FETCH curs2 INTO foo, bar, baz; FETCH LAST FROM curs3 INTO x, y; FETCH RELATIVE -2 FROM curs4 INTO x; + + + + + + <literal>MOVE</> + + +MOVE direction { FROM | IN } cursor; + + + + 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. As with SELECT + INTO, the special variable FOUND can + be checked to see whether the cursor was successfully + repositioned or not. + + + + The direction clause can be any of the + variants allowed in the SQL command except the ones that can move by + more than one row; namely, it can be + NEXT, + PRIOR, + FIRST, + LAST, + ABSOLUTE count, + RELATIVE count, + FORWARD, or + BACKWARD. + Omitting direction is the same + as specifying NEXT. + direction values that require moving + backward are likely to fail unless the cursor was declared or opened + with the SCROLL option. + + + + Examples: + +MOVE curs1; +MOVE LAST FROM curs3; +MOVE RELATIVE -2 FROM curs4; -- cgit v1.2.3