Re: using TCL with sqlite database...
- From: Jan Van Belle <janvanbelle@xxxxxxxxx>
- Date: Tue, 28 Nov 2006 20:07:50 +0100
Hello Christian,
You're absolutely right about the first part.
About the second part, you're right too.
I tried the following statements:
sqldb eval { insert into $table values ($data) }
.... which fails and ...
sqldb eval "insert into $table values ($data)"
.... which succeeds ...
However, in the manual they recommend the first approach to the second one.
If I could use variables instead of writing out each command, it would be
much easier ;-)
Thanks,
Jan
Christian Nassau wrote:
Actually, the line
write_sqlite_db { "t_test" "some data" }
should give you a syntax error, since your write_sqlite_db takes two
arguments. You probably meant
write_sqlite_db "t_test" "some data"
Can it be that you have a "catch" somewhere which hides the error message?
Also, sqlite probably doesn't allow you to use a variable as table name
in the insert statement. You could instead try
proc write_sqlite_db {table val} {
testdb eval "insert into $table values(\$val)"
}
On the other hand that is much more inefficient since you're then
re-parsing the sql-statement on each execution.
.
- Follow-Ups:
- Re: using TCL with sqlite database...
- From: Christian Nassau
- Re: using TCL with sqlite database...
- References:
- using TCL with sqlite database...
- From: Jan Van Belle
- Re: using TCL with sqlite database...
- From: Christian Nassau
- using TCL with sqlite database...
- Prev by Date: Re: Scrollbar with multiple "listboxes"
- Next by Date: Re: using TCL with sqlite database...
- Previous by thread: Re: using TCL with sqlite database...
- Next by thread: Re: using TCL with sqlite database...
- Index(es):
Relevant Pages
|