Changeset 29092
- Timestamp:
- Sep 1, 2010, 12:33:21 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm
r29087 r29092 15 15 # 16 16 ########################################################################### 17 sub get ListOfBatchesOnDatastore{17 sub getBatches { 18 18 my ($self, $batches, $fromTime, $toTime) = @_; 19 19 20 20 my $query = $self->{_db}->prepare(<<SQL); 21 SELECT created, exp_id, batch_id, survey_id, deleted 21 SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged 22 22 FROM batches 23 WHERE processed = 1 24 AND on_datastore = 1 25 AND created >= '$fromTime' 23 WHERE created >= '$fromTime' 26 24 AND created <= '$toTime'; 27 25 SQL … … 41 39 # 42 40 ########################################################################### 43 sub get SingleBatch{41 sub getBatch{ 44 42 my ($self, $batch_id, $batches) = @_; 45 43 46 44 my $query = $self->{_db}->prepare(<<SQL); 47 SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db 45 SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged 48 46 FROM batches 49 47 WHERE batch_id = $batch_id 50 SQL51 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 datastore63 #64 ###########################################################################65 sub getSingleBatchOnDatastore{66 my ($self, $batch_id, $batches) = @_;67 68 my $query = $self->{_db}->prepare(<<SQL);69 SELECT created, exp_id, batch_id, survey_id, deleted70 FROM batches71 WHERE batch_id = $batch_id72 AND processed = 173 AND on_datastore = 1;74 48 SQL 75 49
Note:
See TracChangeset
for help on using the changeset viewer.
