[Haskell-cafe] simple hsql question
sacha at myxomop.com
Sun Aug 16 10:54:32 EDT 2009
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.
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
More information about the Haskell-Cafe