Chapter 9 SQL Statements
641
UPDATE (positioned) statement
Use this statement to modify the data at the current location of a cursor.
UPDATE WHERE CURRENT OF
cursor-name
… { USING DESCRIPTOR
sqlda-name
| FROM
host-variable-list
}
UPDATE
table-list
… SET
set-item
, …
… WHERE CURRENT OF
cursor-name
host-variable-list:
indicator
variables
allowed
set-item:
column-name
[.
field-name
…] =
expression
|
column-name
[.
field-name
…].
method-name
( [
expression
] )
sqlda-name
:
identifier
Must have UPDATE permission on the columns being modified.
None.
"DELETE statement" on page 496
"DELETE (positioned) statement" on page 498
"UPDATE statement" on page 637
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 must not have been a
positioned DELETE statement.
For syntax 1, columns from the SQLDA or values from the host variable list
correspond one-to-one with the columns returned from the specified cursor.
If the sqldata pointer in the SQLDA is the null pointer, the corresponding
select list item is not updated.
In syntax 2, the requested columns are set to the specified values for the row
at the current row of the specified query. The columns do not need to be in
the select list of the specified open cursor. This format can be prepared.
The USING DESCRIPTOR, FROM host-variable-list, and host-variable
formats are for embedded SQL only.
♦
SQL/92 Entry level feature. The range of cursors that can be updated
may contain vendor extensions if the ANSI_UPDATE_CONSTRAINTS
option is set to OFF.
Function
Syntax 1
Syntax 2
Permissions
Side effects
See also
Description
Standards and
compatibility