open

Opens a cursor for processing.

Syntax

open cursor_name

Parameters

Examples

Usage

  • open opens a cursor. Cursors allow you to modify or delete rows on an individual basis. You must first open a cursor to use the fetch, update, and delete statements. For more information about cursors, see the Transact-SQL User’s Guide.

  • The SAP ASE server returns an error message if the cursor is already open or if the cursor has not been created with the declare cursor statement.

  • Opening the cursor causes the SAP ASE server to evaluate the select statement that defines the cursor (specified in the declare cursor statement) and makes the cursor result set available for processing.

  • When the cursor is first opened, it is positioned before the first row of the cursor result set.

  • You can use open with an archive database.

  • When you set the chained transaction mode, the SAP ASE server implicitly begins a transaction with the open statement if no transaction is currently active.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

open permission defaults to all users.

Related reference
close
declare cursor
fetch