[Bio] / FigKernelPackages / DBrtns.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/DBrtns.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21, Wed Jul 27 17:56:13 2005 UTC revision 1.22, Tue Aug 16 19:41:12 2005 UTC
# Line 32  Line 32 
32  =cut  =cut
33    
34  sub get_inserted_id {  sub get_inserted_id {
35      my($self, $table, $sth) = @_;      my($self, $table, $sth, $id_column) = @_;
36    
37        $id_column = 'id' unless defined($id_column);
38      if ($self->{_dbms} eq "Pg") {      if ($self->{_dbms} eq "Pg") {
39          my $oid = $sth->{pg_oid_status};          my $oid = $sth->{pg_oid_status};
40          my $ret = $self->SQL("select id from $table where oid = ?", undef, $oid);          my $ret = $self->SQL("select $id_column from $table where oid = ?", undef, $oid);
41          return $ret->[0]->[0];          return $ret->[0]->[0];
42      } elsif ($self->{_dbms} eq "mysql") {      } elsif ($self->{_dbms} eq "mysql") {
43          my $id = $self->{_dbh}->{mysql_insertid};          my $id = $self->{_dbh}->{mysql_insertid};

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3