Postgresql 中文操作指南

SPI_scroll_cursor_move

SPI_scroll_cursor_move——移动游标

SPI_scroll_cursor_move — move a cursor

Synopsis

void SPI_scroll_cursor_move(Portal portal, FetchDirection direction,
                            long count)

Description

SPI_scroll_cursor_move 跳过游标中的一些行数。它等同于 SQL 命令 MOVE

SPI_scroll_cursor_move skips over some number of rows in a cursor. This is equivalent to the SQL command MOVE.

Arguments

  • Portal _portal_

    • portal containing the cursor

  • FetchDirection _direction_

    • one of FETCH_FORWARD, FETCH_BACKWARD, FETCH_ABSOLUTE or FETCH_RELATIVE

  • long _count_

    • number of rows to move for FETCH_FORWARD or FETCH_BACKWARD; absolute row number to move to for FETCH_ABSOLUTE; or relative row number to move to for FETCH_RELATIVE

Return Value

成功执行时 SPI_processed 设置如 SPI_execute 中所述。 SPI_tuptable 设置为 NULL ,因为此函数不返回任何行。

SPI_processed is set as in SPI_execute if successful. SPI_tuptable is set to NULL, since no rows are returned by this function.

Notes

有关 directioncount 参数解释的详细信息,请参阅 SQL FETCH 命令。

See the SQL FETCH command for details of the interpretation of the direction and count parameters.

如果未使用 CURSOR_OPT_SCROLL 选项创建游标的计划,则 FETCH_FORWARD 以外の其他方向值可能会失败。

Direction values other than FETCH_FORWARD may fail if the cursor’s plan was not created with the CURSOR_OPT_SCROLL option.