update (core)

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

Examples

Usage

  • Any valid object in the catalog can be substituted for table_name, view_name, and so forth.

  • Adaptive Server/CIS issues a cursor update request if it must examine any column data to fulfill the client request, subject to these conditions:
    • More than one table is involved in the update statement.

    • The statement contains built-in functions in its where clause.

    • A column name is referenced to the right of any set expression.

  • Adaptive Server/CIS passes the update command to the DirectConnect server as this series of cursor commands:
    • declare (define parameter formats)
    • open (define parameter data)
    • close
    • deallocate
  • The cursor can be reused multiple times before it is deallocated.

  • Upon completion of the update command, the number of rows affected must be indicated.

  • ODBC does not support a from clause in the update statement. The access service ignores the from clause.