update (core)

Description

Changes data in a row made current by a read cursor by adding data or modifying existing data (cursor event).

Syntax

Transact-SQL Syntax

update [[database.]owner.]{table_name | view_name}
set [[[database.]owner.]{table_name. | view_name.}]
 column_name1 =
 {expression1 | NULL | (select_statement)}
 [, column_name2 =
 {expression2 | NULL | (select_statement)}
 where current of cursor_name

ODBC Syntax

UPDATE table_name
SET column_idenfifier={expression|NULL}
 [,column_identifier={expression|NULL}]...
WHERE CURRENT OF cursor_name

Parameters

set

specifies the column name and assigns the new value. The value is passed as a cursor parameter.

where current of

causes ASE to update the row of the table or view indicated by the current cursor position for cursor_name.

Examples

Example 1

update authors 
set au_lname = @p1

The row made current by the cursor authors_cursor is modified. The column au_lname is set to the value of the parameter @p1.

Usage