Annoyance with SQLite3
Hi,
I have a strange problem with sqlite3.
Code:
NSString *queryStatementNS = "drop table \"myTABLE\"";
const char *queryStatement = [queryStatementNS UTF8String];
if(sqlite3_prepare_v2 (db, queryStatement, -1, &dbps, NULL) == SQLITE_OK)
{
if(sqlite3_step (dbps) == SQLITE_OK)
{
}
else
{
NSLog(@"SQL step failed code: %d", sqlite3_step (dbps));
NSLog(@"Attempted Query: %@", queryStatementNS);
}
sqlite3_finalize (dbps);
sqlite3_close(db);
}
Output:
SQL step failed code: 21
Attempted Query: drop table "myTABLE"
I often get this error. Is the syntax wrong ? I checked online which says error 21 means SQLITE_MISUSE.
I thought this error would come up only when we have special characters in the query.
What am I doing wrong ?
Plz help.
Thanks.
Last edited by cation007; 07-22-2009 at 09:16 PM.
Reason: missing information
|