From: Carl Youngblood Date: 2004-07-29T07:58:52+09:00 Subject: Re: Stupid ODBC! Oracle and PostgreSQL use sequences, MySQL uses auto_increment fields with GET_LAST_INSERT_ID(), can't remember what MS Access uses, nor what SQLite uses. This is not really ODBC's fault. I think that the SQL spec should specify some standard way of getting the last inserted ID, as well as the count of the number of rows that were affected by the last query. On Thu, 29 Jul 2004 07:04:07 +0900, Lennon Day-Reynolds wrote: > So, in response to David's call for contributions of adapters for > Active Record, I've been working on an ODBC adapter. Unfortunately, > I've come up against a limitation of the ODBC spec when compared to > most native database APIs there appears to be no standard way of > getting an identifier for the last row inserted. Since one of the > primary methods that an Active Record database adapter must implement > ('insert') is expected to return this value, I appear to be stuck for > the moment. > > Does anyone have a general solution for this they've used (or seen > described/mentioned) elsewhere? Alternately, might there be a > workaround to remove this requirement from the adapter interface in > Active Record, w/o breaking the rest of the system? (David, that one's > all yours to answer, most likely.) > > Lennon > >