File indexing completed on 2024-04-06 12:22:58
0001
0002
0003 use lib "./lib";
0004
0005 use warnings;
0006 use strict;
0007 $|++;
0008
0009 use CondDB::MySQL;
0010 use ConnectionFile;
0011
0012 my $condDB = ConnectionFile::connect();
0013
0014 my $dbh = $condDB->{dbh};
0015
0016 my @tables = @{$dbh->selectcol_arrayref("SHOW TABLES")};
0017
0018 @tables = grep /^COND_/, @tables;
0019
0020 my $temp1 =
0021 ;
0022
0023 my $temp2 = ;
0024
0025 my $temp3 = ;
0026
0027 my $temp4 = ;
0028
0029
0030 print join(',',("cond name", "view name", "# ch", "start", "end", "# rows")),
0031 "\n";
0032
0033 foreach (@tables) {
0034 my @data = ($_);
0035 push @data, doit($temp1, $_);
0036 push @data, doit($temp2, $_);
0037 push @data, doit($temp3, $_);
0038 push @data, doit($temp4, $_);
0039
0040 print join(',', @data), "\n";
0041 }
0042
0043 sub doit {
0044 my $sql = shift;
0045 my $table = shift;
0046 $sql =~ s/\?/$table/g;
0047 return $dbh->selectrow_array($sql);
0048 }