Wondering if anyone has used SQLite. I'm having trouble with the basics.
sqlite3_get_table function.
The Apress book 'The Definitive Guide to SQLite' provides the following example. The first problem is that when declaring char *result[]; Things start to go wrong.
I get an error message saying that 'the size of result can't be determined'.
On top of this, I can't seem to get the &nrows and &ncols arguments right. The compiler keeps telling me that I can't compare an int to a char. I'm just not sure how to interpret the arguments for this. Specifically in the Sqlite3_get_table function. The book by Apress, 'The Definitive Guide to Sqlite' I'm finding very difficult to follow.. Would anyone be able to provides some tips on how to get the below working. I'll put my table below the code.
int main(int argc, char **argv)
{
/* Connect to database, etc. */
char *result[];
sql = "select * from episodes;";
rc = sqlite3_get_table(db, sql, &result, &nrows, &ncols, &zErr);
/* Do something with data */
/* Free memory */
sqlite3_free_table(result)
id|value
1|eenie
2|meenie
3|miny
4|mo
5|moo
Thanks to anyone who can help me..