Forwarding to list
-------- Original Message --------
Subject: Re: [Haskell-cafe] How to select last inserted record from
Table Using Database.HSQL.MySQL
Date: Tue, 26 Jul 2011 14:27:56 +0300
From: Sergiy Nazarenko <[email protected]>
To: Steffen Schuldenzucker <[email protected]>
Thanx a lot!
I could solve that problem in this way:
cmd = " INSERT INTO mytable (bar,foo) VALUES ("val1","val2"); SELECT
LAST_INSERT_ID() as id;"
lst <- query connection cmd >>= collectRows (\st -> getFieldValue st "id")
lst has required value
Cheers!
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe