The am_update purpose function
The database server calls am_update to process an UPDATE statement.
Syntax
mi_integer am_update(MI_AM_TABLE_DESC *tableDesc,
MI_ROW *row, mi_integer rowid);
- tableDesc
- Points to the table descriptor.
- row
- Points to the row structure that contains the updated values.
- rowid
- Indicates where to write the updated values.
Usage
The am_update function modifies the contents of an existing row.
If the access method
needs to move the updated row, am_update can take
the following actions:
- Deletes the old row
- Adjusts the data format in row to conform to the source data
- Stores the updated source-data record
- Stores the updated row identifier
Important: The database server does not call am_update unless
both the am_rowids and am_readwrite purpose flags are
set.
Important: If the access method does not supply am_update,
but an SQL statement requires it, the database server raises an error.
For more information about how to handle this error, see Supply error messages and a user guide.
For more information, see the purpose flags am_rowids and am_readwrite in Settings purpose functions, flags, and values.
Return values
- MI_OK
- Indicates success.
- MI_ERROR
- Indicates failure.