Changes to select for update

Adaptive Server version 15.7 supports select for update to exclusively lock rows for subsequent updates within the same transaction, and for updatable cursors. This prevents other concurrent tasks from updating these rows and from blocking the subsequent update. select for update is supported at isolation levels 1, 2, and 3.

You can issue select for update as a language statement outside of a cursor context. With both language statements and cursors, you must execute select for update within a begin transaction command or in chained mode.

If you run select for update within a cursor context, the cursor open and fetch statements must be within the context of a transaction, otherwise, Adaptive Server reverts to pre-15.7 functionality.

See "Queries: Selecting Data from a Table" in the Transact-SQL Users Guide.