Note that there are some explanatory texts on larger screens.

plurals
  1. POios sqlite row with ? not read
    primarykey
    data
    text
    <p>I have my sqlite database already built and is copied on application startup. After that I of course run queries (just select statements). So far all but one query works. After some investigation it seems like charNames with spaces some how got "?" added where the spaces are. So instead of "Hello world" I have "Hello?World". for what ever reason this seems to make the my string equal to null.</p> <pre><code>NSString *querySQL = [NSString stringWithFormat: @"select moveName, moveCommand, moveStance, moveHits, moveType, moveDmg, moveHitRange, moveEscape, moveProperties from Moves where charName='%@' and moveCatagory = '%@';",charName, catName]; NSLog(@"move SQL query: %@",querySQL); const char *query_stmt = [querySQL UTF8String]; if (sqlite3_prepare_v2(myDB, query_stmt, -1, &amp;statement, NULL) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { const char* moveName = (const char*)sqlite3_column_text(statement, 0); const char* moveCommand = (const char*)sqlite3_column_text(statement, 1); const char* moveStance = (const char*)sqlite3_column_text(statement, 2); const char* moveHits = (const char*)sqlite3_column_text(statement, 3); const char* moveType = (const char*)sqlite3_column_text(statement, 4); const char* moveDmg = (const char*)sqlite3_column_text(statement, 5); const char* moveHitRange = (const char*)sqlite3_column_text(statement, 6); const char* moveEscape = (const char*)sqlite3_column_text(statement, 7); const char* moveProperties = (const char*)sqlite3_column_text(statement, 8); Move * move = [[Move alloc]init]; if (moveName != nil) { move.moveName = [[NSString alloc] initWithUTF8String:moveName]; NSLog(@"moveName %@",move.moveName); } </code></pre> <p><strong>ETC... COPIED FOR EACH OF THE QUERIED FIELD</strong></p> <p>This will work with all queried fields except moveName. Each of these move rows has a title field (usually without a space) and that title comes through everytime but the rest of the rows have spaces and those come through as null.</p> <p>output from console:</p> <blockquote> <p>2012-05-04 10:35:11.886 my Movelist[2938:f803] moveName Jab</p> <p>2012-05-04 10:35:11.891 my Movelist[2938:f803] moveName (null)</p> <p>2012-05-04 10:35:11.895 my Movelist[2938:f803] moveName (null)</p> </blockquote> <p>output from terminal sqlite3:</p> <blockquote> <p>Jab|1||||8|h|| </p> <p>Forward?Jab|f+1||||8|h|| </p> <p>Down?Jab|d/b+1|RC|||6|s||</p> </blockquote> <p>FYI: for simplicity sake I left out the other fields because they seem to work fine. Like I said I think it has todo with the spaces that seem to only be in the name field.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload