/[corp]/convert/veterina/fix_have_smpc.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /convert/veterina/fix_have_smpc.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Thu Apr 5 11:59:12 2001 UTC (23 years ago) by dpavlin
Branch: MAIN
File MIME type: text/plain
fix have_spmc field in table vet_products

1 dpavlin 1.1 #!/usr/local/bin/perl
2    
3     use DBI;
4     my $dbh = DBI->connect("DBI:Pg:dbname=corp","","") || die $DBI::errstr;
5     my $sth;
6    
7     my $dir="/home/dpavlin/private/corp/public_html/vet";
8     opendir(DIR, $dir) || die "can't opendir $dir: $!";
9     #grep { /^\./ && -f "$dir/$_" && /^\d\d\d\d.htm/ }
10     while($file=readdir(DIR)) {
11     if ($file !~ /^\./ && -f "$dir/$file" && $file =~ /^\d\d\d\d\.htm/) {
12     $file=~s/\.html*//;
13     push @smpcs,$file
14     }
15     }
16     closedir(DIR);
17    
18     $dbh->do("update vet_products set have_smpc=false");
19     $dbh->do("update vet_products set have_smpc=true where smpc in (".join(",",@smpcs).")");

  ViewVC Help
Powered by ViewVC 1.1.26