On 21 Jul 2019, at 8:03pm, test user <example.com.use...@gmail.com> wrote:

> For example: "?, ?10" would have two valid indexes: (1, 10).


Please don't use numbers as names.  That would be extremely confusing to anyone 
trying to understand your code.

> But how can I know that indexes 2-9 are invalid from the API?

You have no reason to believe they're valid.  You made the statement yourself.  
You know what names were used in the statement.  Your statement's parameters 
can be referred to in two ways: by natural numbers (1, 2, 3 ...) or by the 
names you supplied.  If you have somehow lost the list of names you supplied 
you can use

int sqlite3_bind_parameter_count(sqlite3_stmt*);

to figure out how many parameters there are and then

const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);

to return the name of each one.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to