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

Not yet!

If we implement it as a driver specific funtion, then 
you've to call it as shown below:

  dbh.func(:insert_id)

Or when implemented as driver specific attribute:

  dbh['mysql_insert_id']


Regards,

  Michael

-- 
Michael Neumann  ***  eMail uu9r / rz.uni-karlsruhe.de