The index parameter for sqlite3_column_*
is zero-based while sqlite3_bind_*
is one-based.
Is there a reason for this?
I've got it.
Blame sqlite3_bind_parameter_index:
Return the index of an SQL parameter given its name. The index value returned is suitable for use as the second parameter to sqlite3_bind(). A zero is returned if no matching parameter is found.
So there you go. Odd choice, considering they seem to be using a signed int for the index, meaning they could have used -1 to indicate a no-match. Maybe the reason behind that is more historical, SQLite has been around for a while...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With