Rk::M->set_sql(maxid => q(select max(m) from m)); my $sth = Rk::M->sql_maxid; $sth->execute; my ($max) = $sth->fetchrow_array;