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

Diff of /Sprout/ERDB.pm

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

revision 1.91, Wed May 2 05:51:48 2007 UTC revision 1.93, Mon Jul 16 20:04:50 2007 UTC
# Line 1017  Line 1017 
1017              my $oldString = $fieldList->[$i];              my $oldString = $fieldList->[$i];
1018              if (length($oldString) > $maxLen) {              if (length($oldString) > $maxLen) {
1019                  # Here it's too big, so we truncate it.                  # Here it's too big, so we truncate it.
1020                  Trace("Truncating field $i in relation $relName to $maxLen characters from \"$oldString\".") if T(1);                  Trace("Truncating field $i ($fieldTypes->[$i]->{name}) in relation $relName to $maxLen characters from \"$oldString\".") if T(1);
1021                  $fieldList->[$i] = substr $oldString, 0, $maxLen;                  $fieldList->[$i] = substr $oldString, 0, $maxLen;
1022                  $retVal++;                  $retVal++;
1023              }              }
# Line 1564  Line 1564 
1564      my ($suffix, $mappedNameListRef, $mappedNameHashRef) =      my ($suffix, $mappedNameListRef, $mappedNameHashRef) =
1565          $self->_SetupSQL($objectNames, $filterClause);          $self->_SetupSQL($objectNames, $filterClause);
1566      # Create the query.      # Create the query.
1567      my $command = "SELECT DISTINCT " . join(".*, ", @{$mappedNameListRef}) .      my $command = "SELECT " . join(".*, ", @{$mappedNameListRef}) .
1568          ".* $suffix";          ".* $suffix";
1569      my $sth = $self->_GetStatementHandle($command, $params);      my $sth = $self->_GetStatementHandle($command, $params);
1570      # Now we create the relation map, which enables DBQuery to determine the order, name      # Now we create the relation map, which enables DBQuery to determine the order, name
# Line 1665  Line 1665 
1665              $self->_SetupSQL($objectNames, $filterClause, $matchClause);              $self->_SetupSQL($objectNames, $filterClause, $matchClause);
1666          # Create the query. Note that the match clause is inserted at the front of          # Create the query. Note that the match clause is inserted at the front of
1667          # the select fields.          # the select fields.
1668          my $command = "SELECT DISTINCT $matchClause, " . join(".*, ", @{$mappedNameListRef}) .          my $command = "SELECT $matchClause, " . join(".*, ", @{$mappedNameListRef}) .
1669              ".* $suffix";              ".* $suffix";
1670          my $sth = $self->_GetStatementHandle($command, \@myParams);          my $sth = $self->_GetStatementHandle($command, \@myParams);
1671          # Now we create the relation map, which enables DBQuery to determine the order, name          # Now we create the relation map, which enables DBQuery to determine the order, name
# Line 3127  Line 3127 
3127  fields specified returns multiple values, they are flattened in with the rest. For  fields specified returns multiple values, they are flattened in with the rest. For
3128  example, the following call will return a list of the features in a particular  example, the following call will return a list of the features in a particular
3129  spreadsheet cell, and each feature will be represented by a list containing the  spreadsheet cell, and each feature will be represented by a list containing the
3130  feature ID followed by all of its aliases.  feature ID followed by all of its essentiality determinations.
3131    
3132  C<< @query = $erdb->Get(['ContainsFeature', 'Feature'], "ContainsFeature(from-link) = ?", [$ssCellID], ['Feature(id)', 'Feature(alias)']); >>  C<< @query = $erdb->Get(['ContainsFeature', 'Feature'], "ContainsFeature(from-link) = ?", [$ssCellID], ['Feature(id)', 'Feature(essential)']); >>
3133    
3134  =over 4  =over 4
3135    
# Line 4260  Line 4260 
4260  sub _GetStatementHandle {  sub _GetStatementHandle {
4261      # Get the parameters.      # Get the parameters.
4262      my ($self, $command, $params) = @_;      my ($self, $command, $params) = @_;
4263        Confess("Invalid parameter list.") if (! defined($params) || ref($params) ne 'ARRAY');
4264      # Trace the query.      # Trace the query.
4265      Trace("SQL query: $command") if T(SQL => 3);      Trace("SQL query: $command") if T(SQL => 3);
4266      Trace("PARMS: '" . (join "', '", @{$params}) . "'") if (T(SQL => 4) && (@{$params} > 0));      Trace("PARMS: '" . (join "', '", @{$params}) . "'") if (T(SQL => 4) && (@{$params} > 0));

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.93

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3