I am using fmdb for managing my database. I could not find any example for deleting a row from a table in fmdb. I tried
NSString *sqlStat=@"DELETE from tableName WHERE id=3";
FMResultSet *rs = [database executeQuery:sqlStat];
but its not working because when I checked the total number of entries in table, I am getting the same number as before executing the above statement. So, what is a proper way to delete a row from a table using fmdb?
You should replace:
... [database executeQuery:sqlStat] ...
with:
... [database executeUpdate:sqlStat];
Also, try adding:
before your CRUD block, and:
after executing an update/delete/insert operation.
;)
you need to ensure all the processes
FMDB can be a little finicky if you dont pass in the object as an NSNumber. This is the supported, and safe way of formatting queries.
i also ran into the same symptom. and my problem was i didnt call (and caused "out of memory" error)
be sure to do this to debug your fmdb issues db.traceExecution=YES; db.logsErrors=YES;