8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

Updated the docs.

This commit is contained in:
dimitr 2015-03-19 07:09:49 +00:00
parent 57ab9f9c27
commit b1aca05e3a
2 changed files with 81 additions and 0 deletions

View File

@ -291,6 +291,14 @@
Contributor(s): Contributor(s):
Alex Peshkov <peshkoff at mail.ru> Alex Peshkov <peshkoff at mail.ru>
* New feature CORE-4714
Aggregate statistical functions STDDEV_POP, STDDEV_SAMP, VAR_POP and VAR_SAMP
See also:
/doc/sql.extensions/README.statistical_functions.txt
Contributor(s):
Hajime Nakagami <nakagami at gmail.com>
Adriano dos Santos Fernandes <adrianosf at gmail.com>
* New feature CORE-4707 * New feature CORE-4707
Ability to validate tables and indices online (without exclusive access to the database) Ability to validate tables and indices online (without exclusive access to the database)
Contributor(s): Contributor(s):
@ -313,6 +321,8 @@
* New feature CORE-803 * New feature CORE-803
Server bi-directional (aka scrollable) cursors Server bi-directional (aka scrollable) cursors
See also:
/doc/sql.extensions/README.scrollable_cursors.txt
Contributor(s): Contributor(s):
Dmitry Yemanov <dimitr at firebirdsql.org> Dmitry Yemanov <dimitr at firebirdsql.org>

View File

@ -0,0 +1,71 @@
------------------
Scrollable cursors
------------------
Function:
Allow to navigate through the open cursor in any direction rather than sequentially fetching records forward.
Author:
Dmitry Yemanov <dimitr@firebirdsql.org>
Scope:
PSQL, DSQL with additional API support
Syntax rules (PSQL):
// To declare a cursor:
DECLARE CURSOR <name> SCROLL CURSOR FOR ( <select expression> )
// To fetch forward:
FETCH <cursor name> [INTO <var name> [, <var name> ...]];
// To fetch in any direction:
FETCH {NEXT | PRIOR | FIRST | LAST | ABSOLUTE <n> | RELATIVE <n>} FROM <cursor name> [INTO <var name> [, <var name> ...]];
See also /doc/sql.extensions/README.cursors
Usage with API:
Result set must be opened with the flag IStatement::CURSOR_TYPE_SCROLLABLE explicitly specified.
The following fetch methods of the IResultSet interface are available:
int fetchNext(IStatus* status, void* message);
// equal to FETCH NEXT FROM <cursor name>
Moves the cursor's current position to the next row and return it.
If cursor is empty or already positioned at the last row, NO_DATA condition is returned.
int fetchPrior(IStatus* status, void* message);
// equal to FETCH PRIOR FROM <cursor name>
Moves the cursor's current position to the prior row and return it.
If cursor is empty or already positioned at the first row, NO_DATA condition is returned.
int fetchFirst(IStatus* status, void* message);
// equal to FETCH FIRST FROM <cursor name>
Moves the cursor's current position to the first row and return it.
If cursor is empty, NO_DATA condition is returned.
int fetchLast(IStatus* status, void* message);
// equal to FETCH LAST FROM <cursor name>
Moves the cursor's current position to the last row and return it.
If cursor is empty, NO_DATA condition is returned.
int fetchAbsolute(IStatus* status, int position, void* message);
// equal to FETCH ABSOLUTE <position> FROM <cursor name>
Moves the cursor's current position to the specified one and return the located row.
If specified position is beyond the cursor's boundaries, NO_DATA condition is returned.
int fetchRelative(IStatus* status, int offset, void* message);
// equal to FETCH RELATIVE <offset> FROM <cursor name>
Moves the cursor's current position backward or forward by the specified offset and return the located row.
If calculated position is beyond the cursor's boundaries, NO_DATA condition is returned.
Note(s):
1. When a scrolling option is ommitted, NO SCROLL is implied (ie. cursor is opened as forward-only).
In PSQL, this means that only FETCH [NEXT FROM] commands can be used, other commands will return an error.
For API users, this means that only fetchNext() API call can be used, other fetch methods will return an error.
2. Scrollable cursors are internally materialized as a temporary record set,
thus consuming memory/disk resources, so this feature should be used only when really necessary.