[plt-scheme] Parameters in sqlite

From: Erich Rast (erich at snafu.de)
Date: Mon Apr 6 06:12:00 EDT 2009


Is anyone using the Planet sqlite package successfully in 4.1.5 with the
scheme language? I don't have a machine with examples here, but (from
memory) the following things don't seem to work:

1.) Using exec/ignore or any other function with optional parameters
produces a contract violation, indicating that in contrast to the manual
only (exec/ignore db "sql-statement as string") without parameters is
allowed. Strange enough, I've looked at the source code and it looks
alright to me---optional parameters are passed as rest like in (define
(fun arg1 arg2 . rest). I can't any problem with that. Something with
the contracts?

2.) Preparing a statement like "CREATE TABLE ? (id INTEGER PRIMARY KEY,
name TEXT);" using prepare, and then loading the parameter like in
(load-params stm "test") yields an SQL syntax error near "?". But AFAIK,
the ? is perfectly valid for an unnamed parameter in SQLITE3. It's as if
the unicode string is incorrectly converted to something invalid in

I've filed a bug report on PLanet, but still wonder whether I'm not
doing something obviously wrong or just misunderstood the docs. Or is
this a sort of Plt Scheme version incompatibility?

Best regards,


Posted on the users mailing list.