chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: sqlite3 issues


From: Thomas Christian Chust
Subject: [Chicken-users] Re: sqlite3 issues
Date: Wed, 08 Nov 2006 15:07:49 +0100
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; de-AT; rv:1.8.0.7) Gecko/20060910 SeaMonkey/1.0.5

Alejandro Forero Cuervo wrote:

> [...]
> However, I'm failing to get the sqlite3:for-each-row function from
> Chicken's sqlite3 egg to execute for some queries:
> [...]
>     #;5> (sqlite3:for-each-row (constantly #f) db "DELECT FROM links;")
>     Error: (sqlite3:prepare) unrecognized token: ""
>     #<sqlite3:database>
>     "DELECT FROM links;"
> 
>             Call history:
> 
>             <eval>          (sqlite3:for-each-row (constantly #f) db "DELECT 
> FROM links;")
>             <eval>          (constantly #f) <--
> [...]

Hello Alejandro,

the error you posted is apparently thrown by the SQLite3 SQL parser due
to the fact that DELECT is not a valid SQL command. At least on my machine

  (require-extension sqlite3)
  (define db (sqlite3:open ":memory:"))
  (sqlite3:exec db "CREATE TABLE links(foo TEXT);")
  (sqlite3:for-each-row (constantly #f) db "DELETE FROM links;")
  (sqlite3:finalize! db)

works just fine.

By the way, if you don't process the results of the SQL statements you
execute anyway, then using sqlite3:exec or sqlite3:update instead of
sqlite3:for-each-row or sqlite3:map-row is more efficient.

Did you also experience the same or similar problems with any SQL
statement that is valid, i.e. executes correctly, say, from the sqlite3
command line program? If yes, please send me those example(s) and I will
investigate the problem further.

cu,
Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]