I have a function which is supposed to drop the table I'm working on so I can start again. It looks like this :
The console outputs - " Dropped table"
However, if i then print out the table it is still there and so is all the data.
Any ideas? Is the above code not correct?
Code:
- (void) dropData
{
sqlite3_stmt *statement;
char *errMsg;
NSString *sql_stmt = @"DROP TABLE THOUGHT_RECORD";
const char *drop_stmt = [sql_stmt UTF8String];
sqlite3_prepare_v2(thoughtDB, drop_stmt,
-1, &statement, NULL);
if (sqlite3_step(statement) == SQLITE_DONE)
{
status = @"Didn't Drop table";
NSLog(@"Didn't Drop table");
} else
{
NSLog(@"Dropped table");
}
sqlite3_finalize(statement);
sqlite3_close(thoughtDB);
}
The console outputs - " Dropped table"
However, if i then print out the table it is still there and so is all the data.
Any ideas? Is the above code not correct?