On 2017-09-16 12:37 PM, Richard Hipp wrote:
On 9/16/17, Jens Alfke <j...@mooseyard.com> wrote:


On Sep 15, 2017, at 11:40 PM, Wout Mertens <wout.mert...@gmail.com> wrote:

This would be handy when specifying `INSERT INTO t(@?) VALUES(@?)` or
`SELECT
* FROM t WHERE v IN (@?)`.

I'm definitely not an expert on the SQLite virtual machine, but I believe
that changing these parameters [or at least the number of parameters] would
alter the opcodes generated for the statement. Which would require
recompiling the statement. So it wouldn't be feasible to make them bindings.


That is correct.

For the second case ("SELECT * FROM t WHERE v IN ?") you could use the
carray table-valued function (https://www.sqlite.org/carray.html).
But for the INSERT statement, a recompile would be necessary, making
that impractical to do with binding.

I would expect though that if the column list is constant (the INTO is written normally) then the VALUES clause should be replaceable with an array-valued parameter, and no recompile should be needed because what specific fields to expect is known when parsing the SQL. -- Darren Duncan

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to