I'm somewhat confused by binding in the C++ interface. The documentation seems not to be entirely consistent.

My questions fall into several areas:

(1) Form of wildcards:

?
?N
:N:
$N
At various places in the documentation, all of these seem to be mentioned, though not all consistently. At times N is only a numeric integer, while at others it is a fully alphanumeric identifier. The last ($) form, is hinted at only in the header file, near as I can tell.


Are all of these forms allowed?


(2) Wildcard/index mapping:

I'm also confused by the mapping in the API between the wildcard and the bind index.

 INSERT INTO t (a,b,c,d,e) VALUES (?,?1,?,?666,$foo);

The documentation suggests that the second value would be set the same as the first.

- If I do a sqlite3_bind_int(stmt, 1, 99), will the 1st and 2nd values both be set to 99?

- To set the 3rd value do I then use index 2, or 3? (In other words, does the aliasing of 2nd value mean that it doesn't count in the indexing scheme?)

- Does the 4th value get set with index 666, or is just an illegal index, or does it get indexed at 4? Or 3?

- I assume the 5th value gets indexed at 5, if it's even legal, though I've thrown out a bunch of other possibilities above.

Clarification?


(3) Binding of blob data:

If I bind some arbitary bind data, I assume I shouldn't (and wouldn't want to) do any escaping or quoting of null values, etc. Is that correct?


Thanks for any answers. I've read the docs, and headers, many times, but can't seem to form a mental picture of how it really works. I may need to read the code next. As I mentioned above, the docs aren't self-consistent about these things, which makes it even more challenging.


James.




Reply via email to