William Bardwell wrote:
> If I have parameters like "?3, ?" then the parameter count is 4,
> but I can still bind to indexes 1 and 2.  Is this on purpose?
> Is this a good thing?
> 

Yes, its on purpose.

You only need to use the ?n form if you want to use the same parameter 
in multiple locations in your SQL.

If you want to let SQLite manage the numbering of the parameters use the 
:AAA form instead.

If you don't want the overhead of name lookup etc. then you can manage 
the numbering yourself using the ?n form, but you are responsible for 
numbering the parameters correctly.

There is no negative impact to having unused parameters in a query aside 
from a very small increase in memory required to store the arrays or 
parameters. The unused parameters will not be referenced by the VM as it 
executes the query.

> Is there any way to detect that the missing indexes are missing,
> parameter_index and parameter_name don't provide any indication?
> 

No there isn't because the indexes aren't missing. The correct number of 
variables are associated with the query. Some of them may not be bound 
to other values, and will therefore have the null value.

Dennis Cote
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to