FOR UPDATE Clause

Note: GemFire XD does not support this clause from a thin client connection.

The FOR UPDATE clause is an optional part of a SELECT statement. Cursors are read-only by default. The FOR UPDATE clause is required in order to obtain an updatable cursor. For more information about updatability, see Requirements for updatable cursors and updatable ResultSets.

Syntax

FOR
{
    READ ONLY | FETCH ONLY |
    UPDATE [ OF column-name [ , column-name]* ]
}

column-name refers to the names visible for the table specified in the FROM clause of the underlying query.

Note: The FOR UPDATE clause is required to obtain an updatable JDBC ResultSet.

The optimizer is able to use an index even if the column in the index is being updated.

SELECT RECEIVED, SOURCE, SUBJECT, NOTE_TEXT FROM SAMP.IN_TRAY FOR UPDATE;