IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29087


Ignore:
Timestamp:
Aug 31, 2010, 2:53:56 PM (16 years ago)
Author:
rhenders
Message:

Added function to get info for a single batch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm

    r29082 r29087  
    3939#
    4040# Returns a info about one particular batch
     41#
     42###########################################################################
     43sub getSingleBatch{
     44    my ($self, $batch_id, $batches) = @_;
     45
     46    my $query = $self->{_db}->prepare(<<SQL);
     47    SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db
     48        FROM batches
     49        WHERE batch_id = $batch_id
     50SQL
     51 
     52    $query->execute;
     53    ${$batches} = $query->fetchall_arrayref();
     54    my $count = scalar @{${$batches}};
     55
     56   printf( "* Found %d batch%s\n", $count, ($count==1) ? "" : "es");
     57   return $count;
     58}
     59
     60###########################################################################
     61#
     62# Returns a info about one particular batch on the datastore
    4163#
    4264###########################################################################
     
    149171
    150172    my $processed = $query->fetchrow_array();
    151 
    152     if ($processed) {print "* Exposure ID '$expId' has already been processed\n";}
    153173
    154174    return $processed;
Note: See TracChangeset for help on using the changeset viewer.