> // here maybe NULL is returned ? > mydetails = (char*)sqlite3_column_text(stmt, 0 );
Check sqlite3_column_type() before calling sqlite3_column_text(). If it returns SQLITE_NULL then you have NULL. Pavel On Wed, Jul 11, 2012 at 1:40 PM, deltagam...@gmx.net <deltagam...@gmx.net> wrote: > Hello, > > how to process if the select-statement selects a column with NULL ? > > > ========================================== > char *mydetails; > char *sql; > sqlite3_stmt *stmt; > sqlite3 *db; > const char dbname[] = "mysqlite.db"; > > > sql = "Select mydetails from mytable"; > > rc = sqlite3_prepare(db, sql, strlen(sql), &stmt, NULL); > > rc = sqlite3_step(stmt); > > > while(rc == SQLITE_ROW) { > > // here maybe NULL is returned ? > mydetails = (char*)sqlite3_column_text(stmt, 0 ); > rc = sqlite3_step(stmt); > } > ======================================= > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users