I have written the following trigger. When I execute it, ghc. exe crashes.
It says "ghc.exe has stopped working. windows is currently looking for a solution to this problem. This is something I've never experienced".
calculateNoOfStocksTraded ::String->Database.HDBC.Sqlite3.Connection->IO ()
calculateNoOfStocksTraded code conn=do
res <- quickQuery' conn "SELECT SUM(volume) FROM historicalData WHERE companyCode = ? " [toSql code]
let conv=convertSqlValToInt res
run conn "CREATE TRIGGER calStocks \
\AFTER INSERT ON historicalData \
\FOR EACH ROW \
\BEGIN \
\UPDATE company \
\SET noOfStocks= ? ; \
\END; " [toSql (conv::Integer)]
commit conn