Added create_priv and drop_priv to koha's mysql user (needed for updating the
[koha.git] / misc / fixorders.pl
blobf2792fd5f1ce2db57cdde8a958e423c7d6777e19
1 #!/usr/bin/perl
3 use C4::Database;
4 use strict;
6 my $dbh=C4Connect;
8 my $sth=$dbh->prepare("Select ordernumber,biblionumber from aqorders order by ordernumber");
9 $sth->execute;
10 my $number;
11 my $i=92000;
12 while (my $data=$sth->fetchrow_hashref){
13 if ($data->{'ordernumber'} != $number){
14 } else {
15 my $query="update aqorders set ordernumber=$i where ordernumber=$data->{'ordernumber'} and biblionumber=$data->{'biblionumber'}";
16 my $sth2=$dbh->prepare($query);
17 $sth2->execute;
18 $sth2->finish;
19 $query="update aqorderbreakdown set ordernumber=$i where ordernumber=$data->{'ordernumber'}";
20 $sth2=$dbh->prepare($query);
21 $sth2->execute;
22 $sth2->finish;
23 $i++;
25 $number=$data->{'ordernumber'};
27 $sth->finish;
30 $dbh->disconnect;