[Haskell-cafe] haskelldb + sqlite problem.

John Goerzen jgoerzen at complete.org
Mon Jun 22 17:05:17 EDT 2009

Magicloud Magiclouds wrote:
> Hi,
>   I am using haskelldb and haskelldb-hdbc-sqlite3. Well, I finally got
> the source compiled and ran, I got this error:
> App: user error (SQL error: SqlError {seState = "", seNativeError =
> 21, seErrorMsg = "prepare 74: SELECT subject,\n       timestamp\nFROM
> notes as T1\nORDER BY timestamp DESC: library routine called out of
> sequence"})
>   Any clue what I should check? Thanks.

At the HDBC level, I would say:

I suspect that you have used a function that returns results lazily, but
haven't completely read them before calling back into the database with
something else.  As an example, you should probably use quickQuery'
instead of quickQuery, unless you are fully prepared to accept the
consequences of reading data lazily from a database.

I am not very familiar with HaskellDB, and can't really comment on what
it's doing under the hood.  If it is returning results to you lazily,
make sure you have completely consumed them before sending more queries
to the database.

If you can post some example code, it would likely help.

-- John

More information about the Haskell-Cafe mailing list