I have a perl script that loads data from an Excel XLS file into a database. Firstly, it checks if the values from the file exist in the datetime database. If so, it checks to see if the value from the file matches the value that is in the database. If they match, the value is skipped. If they differ, the value in the database is updated.
Code that performs the comparison:
if($dbVal != $fileVal) {
&UpdateData($id, $dt, $fileVal);
}
The problem is that sometimes, although the two values look the same, the comparison decides that they are not, and an update is performed. The following is a snippet of the debug log. For each value from the file, it prints the db value and the file value. If the update is in progress, the line "Update ..." is displayed:
dbVal = '68800812'; file val = '68800812'
dbVal = '66649164'; file val = '66649164'
Updating: 41248 : 01/01/2011 07:00 : 66649164
dbVal = '64975681'; file val = '64975681'
dbVal = '64037179'; file val = '64037179'
dbVal = '64095165'; file val = '64095165'
dbVal = '64917078'; file val = '64917078'
dbVal = '66584188'; file val = '66584188'
Updating: 41248 : 01/01/2011 12:00 : 66584188
, , db val val , , , true, , .
/?
Dave