[sqlite] Selecting NULL

2012-07-11 Thread deltagam...@gmx.net
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,

Re: [sqlite] Selecting NULL

2012-07-11 Thread Pavel Ivanov
// 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:

Re: [sqlite] Selecting NULL

2012-07-11 Thread deltagam...@gmx.net
Am 11.07.2012 19:45, schrieb Pavel Ivanov: // 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,

Re: [sqlite] Selecting NULL

2012-07-11 Thread Pavel Ivanov
On Wed, Jul 11, 2012 at 2:00 PM, deltagam...@gmx.net deltagam...@gmx.net wrote: If mydetails contains a value, and I delete this value with SQLite Database Browser it seems not to be a real NULL, has someone an explanation for this behaviour ? It depends on your meaning of word delete. But

Re: [sqlite] Selecting NULL

2012-07-11 Thread Igor Tandetnik
On 7/11/2012 2:00 PM, deltagam...@gmx.net wrote: If mydetails contains a value, and I delete this value with SQLite Database Browser it seems not to be a real NULL, has someone an explanation for this behaviour ? The tool probably sets the field to an empty string, which is not the same as