On Sun, 16 Apr 2006 22:15:22 +1000, Daniel Kasak wrote:
Hi Daniel
DBI: V 1.47
DBD::mysql: V 3.002
sub last_insert_id
{
my($self, $table_name) = @_;
my($id);
if ($self -> db_vendor() =~ /(?:mysql|Pg)/)
{
$id = $self -> dbh() -> last_insert_id(undef, undef,
$table_name, undef);
}
else # Oracle.
{
my($sth) = $self -> dbh() -> prepare("select
${table_name}_id_seq.currval from
dual");
$sth -> execute();
$id = ${$sth -> fetch()}[0];
$sth -> finish();
}
return $id;
} # End of last_insert_id.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 17/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company