SQLite Forum

sqlite3_exec: the 3rd argument
Login
> The callback function is executed as many times as there are rowsin [sic] the result. Correct?

That's what the docs for sqlite3_exec() claim, and I have found it to be true.

> The callback function returns the column names every time it is called? Correct? If affirmative, isn't this superfluous?

Yes, and no. For some applications, it is a great convenience that the column names are available to the callback.

> How does the callback function handle the different types in the result columns? (Int, Float etc)?

That would be up to the library user. The sqlite3_column_type() function is likely to be useful if the column types are not known or thought to be coerceable.

> My callback function consistently fails on the second call: any ideas on how to overcome this? (I'm using C#)

It is time to learn how to use a debugger. Also, interfaces between the .Net CLR execution context and native code are generally non-trivial. More study is indicated. My guess is that you have botched a memory ownership issue. However, this subtopic is truly off-topic in this forum.