http://sqlite.org/draft/rowvalue.html

Quote<<

A "row value" is an ordered list of two or more scalar values. In other words, 
a "row value" is a vector.>>



some word in the above sentence not strictly correct. A “row value” is a tuple, 
not a vector. When your using a tuple, you know how many items in it, and the 
type of each item of it.



Like “SELECT * FROM CUSTOMER WHERE (first_name, last_name, birthday) = ( :1, 
:2, :3)”

Obviously, LHS and RHS is a tuple, sqlite3_bind_values() is not needed for 
above SQL statements.



A vector is an arbitrary length of elements of same type.

Like “SELECT * FROM CUSTOMER WHERE CUST_ID  IN (?, ?, ?, ? ….)”



What you need is sqlite3_bind_vector(), And that’s carray extension work for, 
simple modify a few lines, it will support blobs or your custom type. I don’t 
think a dedicated sqlite3_bind_values() or sqlite3_bind_vector() worth the 
effort.



Zhai



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



From: Dominique Devienne<mailto:ddevie...@gmail.com>
Sent: 2016年9月23日 23:29
To: SQLite mailing list<mailto:sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14



On Fri, Sep 23, 2016 at 5:04 PM, Keith Medcalf <kmedc...@dessus.com> wrote:

> [...] bind the RHS of a IN operator of arbitrary size [...]
>
> A carray won't work for you?


No. carray doesn't support blobs.

The semantic of carray is fundamentally flawed for variable-sized values.
And the lifetime management, or lack thereof, is also fundamentally flawed.

Binding is about providing explicit values to a compiled statement.

Binding a surrogate (a raw pointer...) to those values, to a table-valued
function,
which further assumes a given representation in memory, which for char*
implies
an indirection to some other memory slots which must be null-terminated,
that's
all very "icky" IMHO, and most unlike SQLite's usual clean designs.

My proposed sqlite3_bind_row_value() is I think much closer to SQLite's
norm. FWIW. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to