The am_delete purpose function
The database server calls am_delete for:
- A DELETE statement
- An UPDATE statement that requires a change in physical location
- An ALTER FRAGMENT statement that moves a row to a different fragment
- A MERGE statement, which can perform both INSERT and DELETE or UPDATE operations on the result of an outer join of two tables
Syntax
mi_integer am_delete(MI_AM_TABLE_DESC *tableDesc,
mi_integer rowID))
- tableDesc
- Points to the table descriptor.
- rowID
- Is the identifier of the row to delete.
Usage
The am_delete purpose
function deletes one row in the virtual table. In response to a DELETE
statement, the database server first calls the appropriate purpose
functions to scan for the table entry or entries that qualify for
deletion and then executes am_delete separately
for each qualifying entry.
Important: The database server
does not call the am_delete purpose function unless
you set both the am_rowids and am_readwrite purpose
flags.
Important: If the access method does not
supply an am_delete purpose function, 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.