i wnant to fetch the data fromt the database but getting error when i try to get the empty column... i used the following code to do it.. NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)]; so if my second column is empty than i get exception
0
votes
have got the solution to do this... NSString aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text_check(compiledStatement, 2)]; const unsigned char *sqlite3_column_text_check(sqlite3_stmt stmt, int iCol){ const unsigned char *val = sqlite3_column_text(stmt,iCol); if(val==nil) return (unsigned char *)""; else return val; }
– Jaimin