Andrew Piskorski wrote:
On Tue, Aug 24, 2004 at 02:55:51PM -0400, D. Richard Hipp wrote:
In this way, I get to specify TCL variables directly in the
SQL statement, not as parameters added to the end. For
example:
db eval {UPDATE t1 SET value=$bigblob WHERE rowid=$id}
Dr. Hipp, this is a great little feature, but is there some reason you
chose to use '$' to indicate a bind variable rather than the more
typical ':' symbol?
The expression part of a TCL "if" or "while" statement uses '$' in
exactly the same way. TCL programmers are used to using '$' like this.
Note that SQLite accepts full TCL variable name syntax. So you can
do complex stuff like this:
db eval {UPDATE t1 SET value=$::main::blob1(label) WHERE rowidid=$id}
^^^^^^^^^^^^^^^^^^^^^
I would have allowed arbitrary TCL code using "[...]" except for
the fact that square brackets are already used as a quoting character
by SQL Server. I may yet go in and add this capability as an option.
As currently implemented in SQLite, the ":NNN:" wildcards require
a number in between the two colons. And that number becomes the
number that the sqlite3_bind_...() statement refers to. So if
you have ":10:" in your SQL, you bind it as index 10.
But I can change that so that you can have arbitrary text in between
the two colons, if doing so will help anybody's interfacing efforts.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565