<br>
conn = sqlite3_open(&quot;...&quot;);<br>
// create a prepared statement:<br>
stmt = sqlite3_prepare(conn, &quot;SELECT * from test_table&quot;);<br>
<br>
// process all rows in the result<br>
while (sqlite3_step(stmt) != SQLITE_DONE)<br>
{<br>
// access the current row<br>
char* colValue = sqlite3_column_text(stmt, columnNdx);<br>
// there are separate column accessors for different types, like<br>
sqlite_column_blob, text, etc.<br>
}<br>
sqlite3_finalize(stmt);<br>
sqlite3_close(conn);<br></blockquote></div><br><br>Basically, the aim of the low level binding is to create this sort of
pseudo-C in Haskell, though it would be preferable to not have to
explicitly finalize the statement. (Though I did end up adding
unsafeFreeResult to postgresql-libpq to explicitly trigger the finalizer
that calls PQclear, for better or worse. I did so at the request of
Felipe Lessa for use in persistent-postgresql.)<br><br>Best,<br>Leon<br>