Good morning,
I'm using "Real World Haskell" and a Windows Vista
PC and I have Sqlite3 installed...[note: I had to change
test1.db to /users/user/test1.db in order to get
this to work, otherwise, neither the database nor the table could be created --
also, note c:/users/user/test1.db gives a syntax error],
ghci doesn't like c:/]:
I tried to use the following example from the book
but it failed...see following:
Prelude> :m Database.HDBC
Database.HDBC.Sqlite3
Prelude Database.HDBC Database.HDBC.Sqlite3> conn
<- connectSqlite3 "/users/user/test1.db"
...
Prelude Database.HDBC
Database.HDBC.Sqlite3> run conn "INSERT INTO test VALUES (?, ?)" [toSql 0,
toSql "zero"]
<interactive>:1:43:
No
instance for (Data.Convertible.Base.Convertible t
SqlValue)
arising from a use of `toSql' at
<interactive>:1:43-49
Possible
fix:
add an instance declaration
for
(Data.Convertible.Base.Convertible t
SqlValue)
In the expression: toSql 0
In the third argument of `run', namely `[toSql 0, toSql
"zero"]'
In the
expression:
run conn "INSERT INTO
test VALUES (?, ?)" [toSql 0, toSql "zero"]
I'd appreciate any advice...