So I can create the database with no issue using the following statement for the first table:
const char *sqlStatement = "CREATE TABLE IF NOT EXISTS LIBRARY_SEARCH (SEARCH_ID INTEGER PRIMARY KEY AUTOINCREMENT, SEARCH_TERM TEXT)";
But when I go to insert a row it fails. This is how I insert the row.
NSString *insertStatement = [NSString stringWithFormat:@"INSERT INTO LIBRARY_SEARCH(SEARCH_TERM) VALUES (\"%@\")", myQuery] ;
Where myQuery is an NSString that holds the value of the searchBar.text in the app. It’s a property and is of course synthesized.
So I then call this:
if ( sqlite3_exec(searchSessionDB, [insertStatement UTF8String], NULL, NULL, &insert_error) == SQLITE_OK)
Which fails. Can anyone see why?
Got it. Made a small typo in my open database statement.
For anyone who looks at this in the future, this is how the opening statement now looks (and it works fine!):
Thanks to Robert Ryan for suggesting this NSLog:
And thanks Elpsk and H2CO3 for the wrapper/app bundle information.