Functions | |
RDM_RETCODE | rdm_dbDeleteAllRowsFromDatabase (RDM_DB db) |
Remove all rows from a database. More... | |
RDM_RETCODE | rdm_dbDeleteAllRowsFromTable (RDM_DB db, RDM_TABLE_ID tableId) |
Remove all rows from a table. More... | |
API for deleting all rows from a table or a database. All the functions here are located in RDM DB Engine Library. Linker option:
-lrdmrdm
RDM_RETCODE rdm_dbDeleteAllRowsFromDatabase | ( | RDM_DB | db | ) |
#include <rdmdbapi.h>
Remove all rows from a database.
This function removes all rows from all tables in the database.
No triggers or other checks will be performed when a database has all of it's rows delete in this manner. Once this is called the database will be completely empty with no rows in any of the database tables.
This function must be performed within a transaction (optional in exclusive mode or when used with the standalone transactional file server). If the transaction is aborted, the database will remain unchanged.
Please note that any row IDs that was used prior to this call will be reused after a successful call to this function.
sOKAY | Normal, successful return. |
eDBNOTOPEN | Database not open. |
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. |
ePRECOMMITTED | A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eREADONLY | Database is read-only and cannot be updated. |
[in] | db | A valid RDM database handle |
RDM_RETCODE rdm_dbDeleteAllRowsFromTable | ( | RDM_DB | db, |
RDM_TABLE_ID | tableId | ||
) |
#include <rdmdbapi.h>
Remove all rows from a table.
This function deletes all of the rows in the specified table.
The ability to delete rows will be based on the triggered action specified in the table definition. Rows 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 on the on delete triggered action.
If the triggered action is:
sOKAY | Normal, successful return. |
eDBNOTOPEN | Database not open. |
eDBOPEN | Database already opened in this task. |
eHASMEMBERS | Referential Integrity error - row is referenced by other rows. |
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. |
eREADONLY | Database is read-only and cannot be updated. |
[in] | db | A valid RDM database handle |
[in] | tableId | The table identifier for the table to be initialized |