ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/dinfo/dinfo-import2
Revision: 1.2
Committed: Tue Aug 26 13:41:01 2003 UTC (20 years, 10 months ago) by root
Branch: MAIN
Changes since 1.1: +2 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/usr/bin/perl
2    
3     use PApp::SQL;
4    
5     local $PApp::SQL::DBH = PApp::SQL::connect_cached "dinfo::", "DBI:mysql:dinfo";
6    
7     for my $col (qw(
8     name
9     vorname
10     zusatz1
11     zusatz2
12     zusatz3
13     vorwahl
14     strasse
15     haus
16     plz
17     ort
18     branche
19     )) {
20     my ($id, $count) = sql_fetch "select $col, count(*) from row group by 1 order by 2 desc limit 1";
21     warn "$col => ($id) * $count\n";
22     next unless $id;
23 root 1.2 sql_exec "update $col set id = 0 where id = ?", $id;
24     sql_exec "update row set $col = 0 where $col = ?", $id;
25 root 1.1 }
26