FETCH cursor

<< EXIT | FB 2.5 Language Reference | FOR EXECUTE STATEMENT ... DO >>
<< EXIT | FB 2.1 Language Reference | FOR EXECUTE STATEMENT ... DO >>
<< EXIT | FB 2.0 Language Reference | FOR EXECUTE STATEMENT ... DO >>

FETCH cursor

Available in: PSQL

Added in: 2.0

Description

Fetches the next data row from a cursor's result set and stores the column values in PSQL variables.

Syntax

 FETCH cursorname INTO [:]varname [, [:]varname ...];

Notes

  • The ROW_COUNT context variable will be 1 if the fetch returned a data row and 0 if the end of the set has been reached.
  • You can do a positioned UPDATE or DELETE on the fetched row with the WHERE CURRENT OF clause.

Example

See DECLARE ... CURSOR.

back to top of page
<< EXIT | FB 2.5 Language Reference | FOR EXECUTE STATEMENT ... DO >>
<< EXIT | FB 2.1 Language Reference | FOR EXECUTE STATEMENT ... DO >>
<< EXIT | FB 2.0 Language Reference | FOR EXECUTE STATEMENT ... DO >>