From: Michael Neumann Date: 2002-05-22T04:23:46+09:00 Subject: Re: DBI access to mysql auto_increment record numbers? On Tue, May 21, 2002 at 03:27:06AM +0900, Sean Chittenden wrote: > > How do you get the auto_increment record number for mysql in > > ruby/dbi/mysql? > > sql = 'INSERT INTO foo (foo_name) VALUES (?)' > dbh.do(sql, my_foo_name) > insert_id = dbh.insert_id > > if insert_id.nil? > raise "bad things happened" > end > > It's untested... but DBD::Mysql#insert_id() should be available via a > DBH instance. -sc New version 0.0.15 supports the following: dbh.func(:insert_id) Regards, Michael -- Michael Neumann *** eMail uu9r@rz.uni-karlsruhe.de