Re: using TCL with sqlite database...



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.



.



Relevant Pages

  • Re: sql functions
    ... > i can cut the function code from books on-line and it stil fails. ... "doesn't work" then you have a syntax error on line 5. ... What is the database ...
    (microsoft.public.sqlserver.programming)
  • DataTable.Select - Thread.CurrentThread.CurrentCulture - String.Format
    ... in my application a.Select fails with "Syntax error in the ... isolate the cause to this: ... To select some datarows from a data table I am using a select sting like ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is there an updated Ghostscript for VMS?
    ... I have tried downloading the latest version, but the build fails with ... MMK spitting out a "syntax error" from one of the .mak files. ...
    (comp.os.vms)
  • JOIN CONTAINSTABLE
    ... i am trying to create a stored procedure on sql 7.0, ... fails with the JOIN CONSTAINSTABLE with a syntax error near @myTXT. ...
    (microsoft.public.sqlserver.server)
  • Building 8.4.4 on SGI
    ... Just having a small prob building tcl 8.4.4 on Irix 6.5.21. ... configured ok, then make, which fails with: ... Makefile line 1347: Syntax error. ...
    (comp.lang.tcl)