Hi

I wanted to see what access to databases HSQL provides and I stumbled in
the very beginning. Assume I have a table map1 with attributes "i" and "s"
interger and varchar() respectively. The following code fails (with
segfault) for me. And I see no other way to tell compiler that I am
expecting an interger to be found as 'i' in a fetched row.

import Database.HSQL
import Database.HSQL.MySQL

main :: IO ()
main = do
    c <- connect "localhost" "tx_test" "sacha" ""
    s <- query c "SELECT i FROM map1"
    print $ getFieldsTypes s
    i <- (getFieldValue s "i")::IO Int
    print i
    disconnect c

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to