On Tuesday 13 December 2005 09:21, Piotr Krukowiecki wrote:
On Tue, Dec 13, 2005 at 09:10:51AM -0500, Rowan Kerr wrote:
Requesting an ID in advance is also a database-dependent feature. MSSQL and others let you do it through their built-in support of sequences, but MySQL only has auto-increment as far as I know.
You can get a sequence just inserted. This also can be done with PostgreSQL, and probably Oracle. Don't know about MSSQL.
If we are going to use auto_increment in Drupal, then the database abstraction layer needs to have a db_last_insert_id() function (or similar name) to abstract getting the last inserted ID number, since the functions to do this differ from one database to another, even if all of the ones we care about do support the feature. Scott -- ------------------------------------------------------------------------------- Scott Courtney Drupal user name: "syscrusher" http://drupal.org/user/9184 scott at 4th dot com Drupal projects: http://drupal.org/project/user/9184 Sandbox: http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/syscrusher