Tutorial by Examples

A statement is constructed with a function such as sqlite3_prepare_v2(). A prepared statement object must be cleaned up with sqlite3_finalize(). Do not forget this in case of an error. If parameters are used, set their values with the sqlite3_bind_xxx() functions. The actual execution happens whe...
A SELECT query is executed like any other statement. To read the returned data, call sqlite3_step() in a loop. It returns: SQLITE_ROW: if the data for the next row is available, or SQLITE_DONE: if there are no more rows, or any error code. If a query does not return any rows, the very first...
After a statement was executed, a call to sqlite3_reset() brings it back into the original state so that it can be re-executed. Typically, while the statement itself stays the same, the parameters are changed: const char *sql = "INSERT INTO MyTable(ID, Name) VALUES (?, ?)"; sqlite3_stmt...

Page 1 of 1