From: R. E. B. <re...@cs...> - 2009-11-14 19:55:46
|
I'm using MySQL with HSQL. MySQL supports this by executing a "SELECT LAST_INSERT_ID()" query. But AFAIK, it is not possible to execute arbitrary SQL in HaskellDB. I can do that if I can access the underlying Connection object of HSQL. Is there a standard method for accomplishing that. Or, to take an alternative approach, is it possible to define that type of query as a HaskellDB table? Justin Bailey der ki: > If you look at your specific database and see how to get the primary > key back out, maybe you can run those statements within a transaction > and get the result back (HaskellDB.Database.transaction). You may have > more luck looking at the underlying driver (e.g., HDBC). > > 2009/11/14 R. Emre Başar <re...@cs...>: > > Hi all, > > > > I'm developing a HaskellDB application using a console interface (with > > HCL library). At some points, I have menus represented to the user. User > > either selects an item from the menu (then I return the value for that > > item) or add a new item using the "Add" option. When user adds the new > > item, I need to be able to get a referece back to the newly inserted > > item to use the unique id of that item throughout other parts of my > > program. > > > > Is there a way to get back the value of the latest insertion? > > > > -- > > R. Emre Başar > > İstanbul Bilgi University > > Department of Computer Science > > -- R. Emre Başar İstanbul Bilgi University Department of Computer Science |