Cursor (databases)

Cursorcursorsdatabase cursorscrollable cursorsScrolled cursors
In computer science, a database cursor is a control structure that enables traversal over the records in a database.wikipedia
33 Related Articles

Iterator

iteratorsIteratingIteratorAggregate
The database cursor characteristic of traversal makes cursors akin to the programming language concept of iterator.
An iterator is behaviorally similar to a database cursor.

Java Database Connectivity

JDBCJava Data Base ConnectivityJava Database Connectivity (JDBC)
Not all application bindings for relational database systems adhere to that standard, and some (such as CLI or JDBC) use a different interface.
In the case of Connections to remote database servers, further resources are tied up on the server, e.g., cursors for currently open ResultSets.

SQL problems requiring cursors

A cursor is a construct available in most implementations of SQL that allows the programmer to handle data in a row-by-row manner rather than as a group.

Computer science

computer scientistcomputer sciencescomputer scientists
In computer science, a database cursor is a control structure that enables traversal over the records in a database.

Traverse

Traverse (disambiguation)traversal
In computer science, a database cursor is a control structure that enables traversal over the records in a database.

Row (database)

rowsrowrecord
In computer science, a database cursor is a control structure that enables traversal over the records in a database.

Result set

SQL result sets
Cursors enable manipulation of whole result sets at once.

SQL:2003

SQLSQL standard2003 version of SQL
This section introduces the ways the SQL:2003 standard defines how to use cursors in applications in embedded SQL.

Call Level Interface

CLICall-Level Interface
Not all application bindings for relational database systems adhere to that standard, and some (such as CLI or JDBC) use a different interface.

Database

database management systemdatabasesDBMS
In computer science, a database cursor is a control structure that enables traversal over the records in a database.

Update (SQL)

UPDATESQL UPDATEupdates
Thus, a positioned UPDATE or positioned DELETE statement will only succeed after a FETCH operation occurred first in the transaction.

Delete (SQL)

DELETE statementdeletes
Thus, a positioned UPDATE or positioned DELETE statement will only succeed after a FETCH operation occurred first in the transaction.

Where (SQL)

WHERELIKEWHERE clause
Such statements do not use a regular WHERE clause with predicates.

X/Open XA

The XA SpecificationX/Open Distributed Transaction ProcessingX/Open Distributed Transaction Processing (DTP) Model
Using cursors in distributed transactions (X/Open XA Environments), which are controlled using a transaction monitor, is no different from cursors in non-distributed transactions.

XQuery

queriedXML query language
The XQuery language allows cursors to be created using the subsequence function.

Round-trip delay time

round-trip timeround trip timeRTT
Fetching a row from the cursor may result in a network round trip each time.

System resource

resourcesresourcesystem resources
Cursors allocate resources on the server, such as locks, packages, processes, and temporary storage.

Record locking

locklocksrecord
Cursors allocate resources on the server, such as locks, packages, processes, and temporary storage.

Microsoft SQL Server

SQL ServerMS SQLMS SQL Server
For example, Microsoft SQL Server implements cursors by creating a temporary table and populating it with the query's result set.

Stored procedure

stored proceduresproceduresdatabase procedures
Such result sets can be processed using cursors, by other stored procedures, by associating a result-set locator, or by applications.

SQL/PSM

Persistent Stored Modules
SQL/PSM standardizes syntax and semantics for control flow, exception handling (called "condition handling" in SQL/PSM), local variables, assignment of expressions to variables and parameters, and (procedural) use of cursors.

DataReader

DataReaders provide a very efficient way to access data, and can be thought of as a Firehose cursor from ASP Classic, except that no server-side cursor is used.