|RDM_RETCODE||rdm_cursorDeleteRow (RDM_CURSOR cursor)|
|Delete a row from a table. More...
API for deleting a row identified by a core cursor. All the functions here are located in RDM DB Engine Library. Linker option:
See cursor for a more detailed description of a cursor.
Delete a row from a table.
This function deletes the current row of cursor from the database.
After the row has been deleted the cursor will no longer have a current row. However it will maintain a virtual position which be the position between the rows neighboring the deleted row. The neighboring rows are dependent upon on the type of cursor.
The ability to delete a row will be based on the triggered action specified in the table definition. A row that only references other rows will be deleted and the references automatically removed. The behavior of a row that is referenced by other rows will be dependent the ON DELETE triggered action.
If the the triggered action is:
- restrict - an error code will be returned and no rows will be deleted
- set null - all rows that reference the row to be deleted will have their referencing foreign key columns set to NULL.
- cascade - all of the rows that reference the row to be deleted will also be deleted. If there are any referential integrity issues with the referencing rows an error code will be returned.
- Locking Requirements
- Write lock on the table the cursor is based on and potentially a write lock (on delete cascade) or a read lock (on delete restrict) on any tables that have rows that reference the row to be deleted.
- Return values
sOKAY Normal, successful return. eREADONLY Database is read-only and cannot be updated. eNOSTARTUPDATE An update operation was attempted when no rdm_dbStartUpdate() is active. eNOTLOCKED Attempt to access a table for reading or update without proper locks. eDBNOTOPEN Database not open. ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed. eREFINTEGRITY Integrity constraint violation.
- See also
[in] cursor The cursor whose current row will be deleted