[Bio] / Sprout / DBQuery.pm Repository:
ViewVC logotype

Diff of /Sprout/DBQuery.pm

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

revision 1.8, Thu Dec 6 14:58:03 2007 UTC revision 1.9, Tue Sep 16 18:57:59 2008 UTC
# Line 62  Line 62 
62      my @row = $sth->fetchrow;      my @row = $sth->fetchrow;
63      # Check to see if we got any results.      # Check to see if we got any results.
64      if (@row == 0) {      if (@row == 0) {
         Trace("No result from query.") if T(3);  
65          # Here we have no result. If we're at the end of the result set, this is okay, because          # Here we have no result. If we're at the end of the result set, this is okay, because
66          # we'll be returning an undefined value in $retVal. If an error occurred, we need to abort.          # we'll be returning an undefined value in $retVal. If an error occurred, we need to abort.
67          if ($sth->err) {          if ($sth->err) {
68              Confess("FETCH error");              Confess("FETCH error: " . $sth->err);
69            } else {
70                # Trace the number of results returned.
71                Trace("$self->{_results} rows processed by query.") if T(SQL => 4);
72          }          }
73      } else {      } else {
74          # Here we have a result, so we need to turn it into an instance object.          # Here we have a result, so we need to turn it into an instance object.
75          $retVal = ERDBObject::_new($self, @row);          $retVal = ERDBObject::_new($self, @row);
76          Trace("Row returned from query.") if T(4);          $self->{_results}++;
77      }      }
78      # Return the result.      # Return the result.
79      return $retVal;      return $retVal;
# Line 119  Line 121 
121      my ($database, $sth, $relationMap, $searchObject) = @_;      my ($database, $sth, $relationMap, $searchObject) = @_;
122      # Create this object.      # Create this object.
123      my $self = { _db => $database, _sth => $sth, _objectNames => $relationMap,      my $self = { _db => $database, _sth => $sth, _objectNames => $relationMap,
124                   _fullText => $searchObject };                   _fullText => $searchObject, _results => 0 };
125      # Bless and return it.      # Bless and return it.
126      bless $self;      bless $self;
127      return $self;      return $self;

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3