Here is the code, it may not be a timeout problem. I am getting about
4200 records out of 80000
sub update_rate_fields
{
$row=1;
# "DB DSN" points to MySQL server and "test_aces_data" DB
$DSN = "DB";
# Make new ODBC object and connect to the server
if (!($rates = new Win32::ODBC($DSN)))
{
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
exit;
}
# Make new ODBC object and connect to the server
if (!($insert_rates = new Win32::ODBC($DSN)))
{
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
exit;
}
# Query to load all data
$reviews_query =
"select
id,
total_num_of_errors,
amount_to_be_inspected,
amount_actually_inspected,
meeting_time,
total_prep_time_hours,
inspected_item_type
from tcgaz_inspections
order by id desc";
# Execute on data
if ($rates -> Sql($reviews_query))
{
# We have an error if we got here
print "SQL failed.\n";
print "Error: " . $rates->Error() . "\n";
# Close it out
$rates->Close();
# Error out of the program
exit;
}
my $now = localtime time;
print "\n$now\n";
undef %id;
$row=1;
while ($rates -> FetchRow())
{
# Clear out for this row
undef %data;
# Get the hash of data
%data = $rates -> DataHash();
$temp_id=$data{"id"};
chomp $temp_id;
# Get our values
$id{$temp_id} = $data{"id"};
$total_num_of_errors{$temp_id} = $data{"total_num_of_errors"};
$meeting_time{$temp_id} = $data{"meeting_time"};
$amount_to_be_inspected{$temp_id} = $data{"amount_to_be_inspected"};
$total_prep_time_hours{$temp_id} = $data{"total_prep_time_hours"};
$amount_actually_inspected{$temp_id} =
$data{"amount_actually_inspected"};
$amount_to_be_inspected{$temp_id} = $data{"amount_to_be_inspected"};
($phase{$temp_id}, $notused{$temp_id}) = split (/:/
,$data{"inspected_item_type"});
$row++;
}
print "\nRetrieved $row records\n";
my $now = localtime time;
print "$now\n";
}