[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.6, Sun Nov 7 23:07:34 2004 UTC revision 1.7, Tue Jan 11 18:59:39 2005 UTC
# Line 59  Line 59 
59  }  }
60    
61  sub SQL {  sub SQL {
62      my($self,$sql,$verbose) = @_;      my($self, $sql, $verbose, @bind_values) = @_;
63      my($dbh,$sth,$rc,$tmp);      my($dbh,$sth,$rc,$tmp);
64    
65      if ($verbose)      if ($verbose)
# Line 71  Line 71 
71    
72      if ($sql =~ /^select/i)      if ($sql =~ /^select/i)
73      {      {
74          $tmp = $dbh->selectall_arrayref($sql);          my $ok = eval {
75                $tmp = $dbh->selectall_arrayref($sql, undef, @bind_values);
76            };
77            if (!$ok)
78            {
79                confess $@;
80            }
81          return $tmp;          return $tmp;
82      }      }
83      else      else
84      {      {
85          return $dbh->do($sql);          return $dbh->do($sql, undef, @bind_values);
86  #       $sth = $dbh->prepare($sql)  #       $sth = $dbh->prepare($sql)
87  #           or die "prepare failed: $DBI::errstr";  #           or die "prepare failed: $DBI::errstr";
88  #       $sth->execute()  #       $sth->execute()

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3