in reply to Re: Conversion to SPROC
in thread Conversion to SPROC
sub calculating_pop_summations_B { my $sthZK_B = $dbh->prepare(" SELECT DISTINCT Aggregated_area FROM Geo_postaggregated_pop_count; ") or die "Couldn't prepare query: ".$dbh->errstr; $sthZK_B->execute() or die "Couldn't execute query: ".$sthZK_B->errs +tr; my @sthZK_B_A_array; while ( my @columns_B = $sthZK_B->fetchrow() ) { my $Aggregated_area = $columns_B[0]; my $sthZK_B_A = " UPDATE Geo_postaggregated_pop_count SET Sum_of_person_count = ( SELECT DISTINCT (SELECT SUM(G.Person_count) FROM Geo_postaggregated_pop_count G WHERE G.Sex = 1 AND G.Aggregated_area LIKE '".$Aggregated_ +area."')+ (SELECT SUM(G.Person_count) FROM Geo_postaggregated_pop_count G WHERE G.Sex = 2 AND G.Aggregated_area LIKE '".$Aggregated_ +area."') FROM Geo_postaggregated_pop_count G WHERE G.Aggregated_area LIKE '".$Aggregated_area."') FROM Geo_postaggregated_pop_count G WHERE G.Aggregated_area LIKE '".$Aggregated_area."' "; push (@sthZK_B_A_array, $sthZK_B_A); } foreach (@sthZK_B_A_array){ my $sthZK_C = $dbh->prepare(" ".$_." ") or die "Couldn't prepare query: ".$dbh->errstr; $sthZK_C->execute() or die "Couldn't execute query: ".$sthZK_C->er +rstr; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Conversion to SPROC
by Win (Novice) on Jun 17, 2004 at 13:45 UTC | |
|
Re^3: Conversion to SPROC
by Win (Novice) on Jun 17, 2004 at 13:24 UTC |