UPDATE (positioned) Statement [ESQL] [SP]

Modifies the data at the current location of a cursor.

Quick Links:

Go to Parameters

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

UPDATE table-list 
   SET set-item, ... 
   WHERE CURRENT OF cursor-name

set-item
   column-name [.field-name…] = scalar-value

Parameters

(back to top)

Examples

(back to top)

Usage

(back to top)

This form of the UPDATE statement updates the current row of the specified cursor. The current row is defined to be the last row successfully fetched from the cursor, and the last operation on the cursor cannot have been a positioned DELETE statement.

The requested columns are set to the specified values for the row at the current row of the specified query. The columns must be in the select list of the specified open cursor.

Changes effected by positioned UPDATE statements are visible in the cursor result set, except where client-side caching prevents seeing these changes. Rows that are updated so that they no longer meet the requirements of the WHERE clause of the open cursor are still visible.

Since SAP Sybase IQ does not support the CREATE VIEW... WITH CHECK OPTION, positioned UPDATE does not support this option. The WITH CHECK OPTION clause does not allow an update that creates a row that is not visible by the view.

A rowid column cannot be updated by a positioned UPDATE.

SAP Sybase IQ supports repeatedly updating the same row in the result set.

Standards

(back to top)

  • The range of cursors that can be updated may contain vendor extensions to ISO/ANSI SQL grammar if the ANSI_UPDATE_CONSTRAINTS option is set to OFF.
  • Embedded SQL use is supported by Open Client/Open Server, and procedure and trigger use is supported in SQL Anywhere.

Permissions

(back to top)

Must have UPDATE permission on the columns being modified.

Related reference
DECLARE CURSOR Statement [ESQL] [SP]
DELETE Statement
DELETE (positioned) Statement [ESQL] [SP]
UPDATE Statement