IT lexicon › Database › Database Cursor

Database Cursor

Database På svenska → Updated: 2026-11-12

A program variable holding the position during database traversal, often sequential.

In legacy navigation databases like CODASYL systems, cursors—similar to modern iterators—tracked your position during a search. An application could open a cursor "over all employees" and read records one by one. The cursor maintained position (often a byte offset or record ID) and provided access to the next element in sequence. The same concept persists in modern databases but is often hidden behind more declarative SQL syntax instead of imperative cursor commands.

Cursors in early systems were necessary because set-oriented access didn't exist—you couldn't say "give me all" without manually looping through results. Modern interfaces typically hide cursor mechanics behind iterator interfaces or SQL's lazy evaluation, even though the underlying implementation uses cursors for buffering internally.

← Back to the lexicon