
16 Aug
2009
16 Aug
'09
10:54 a.m.
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