I recently used the brew database interface to find some error-prone problems. I will record them for your reference.
1. idbrecord_update (idbrecord * pidbrecord, aeedbfield * pdbfields, int inumfields)
To update a field of a record in the database, all the fields of the record must be filled and updated together. Otherwise, if the size of the record used for update is different from that of the original record, this record is not updated, but an additional record is added.
I have not found a way to update the entire record by filling in only one field. If anyone knows, please leave a message and let me know. Thank you very much ~~~~
2. Int idbrecord_remove (idbrecord * pidbrecord )&
Idbrecord * idatabase_getrecordbyid (idatabase * pidatabase, uint16 u16recid)
You can use idbrecord_remove to delete a record in the database. Unfortunately, this does not delete the ID of the record in the database,
If the ID of the deleted record is 2 and the record ID is not updated, use idatabase_getrecordbyid (idatabase *
Pidatabase, 2); what you get is a deleted record, and an error is clearly returned.
It seems that only idbrecord * idatabase_getnextrecord (idatabase * pidatabase) can be used to traverse all records.