ureco has asked for the wisdom of the Perl Monks concerning the following question:
The fields that are undefined are being written as 0.00, 0 or " " not NULL. I found an unclear reference where I thought the ..., undef) parameter on the $dbh->do would map the undef variables to NULL in MySQL but this appears to make no difference. I've read bits on data binding for this but not sure how I can apply it to my code. Hopefully I'm missing something simple - very grateful for any assistance - Thanks# INSERT RECORD INTO MET_OFFICE_RAW_DATA TABLE no warnings 'uninitialized'; my $mo_raw_sql = "REPLACE INTO met_office_raw_data SET observation_datetime_utc = '$file_o +bs_datetime_utc', observation_datetime_local = '$file_obs_d +atetime_local', observation_datetime = '$file_obs_ +datetime', station_id = '$file_stati +on_id', station_name = '$file_station_ +name', temp_c = '$file_temp_c', dewpoint_c = '$file_dewpoint_c +', humidity_rh = '$file_humidity_ +rh', wind_dir_compass = '$file_wind_dir +_compass', wind_speed_mph = '$file_wind_s +peed_mph', wind_gust_mph = '$file_wind_gu +st_mph', visibility_metres = '$file_visibil +ity_metres', pressure_hpa = '$file_pressure +_hpa', pressure_tendency = '$file_pressur +e_tendency', weather_type = '$file_weather_ +type'"; my $mo_raw = $dbh->do($mo_raw_sql, undef) or die "Could not Insert record into met_office_ra +w_data \n";
|
|---|