Changeset 694


Ignore:
Timestamp:
Sep 5, 2009, 2:53:00 PM (10 years ago)
Author:
Dominic Hargreaves
Message:

fix null values in sql, newlines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/report-foreign-deletions

    r693 r694  
    3636
    3737my $sql = <<EOF;
    38 SELECT id,outward||' '||inward AS postcode,easting,northing,ie_easting,ie_northing,reason from postcodes p inner join bad_postcodes b on (p.id=b.postcode) where source=? and delete_reason=1 and deleted='t' order by id;
     38SELECT id,outward||' '||inward AS postcode,coalesce(to_char(easting,'000000'),''),coalesce(to_char(northing,'000000'),''),coalesce(to_char(ie_easting,'000000'),''),coalesce(to_char(ie_northing,'000000'),''),reason from postcodes p inner join bad_postcodes b on (p.id=b.postcode) where source=? and delete_reason=1 and deleted='t' order by id;
    3939EOF
    4040
     
    6060EOF
    6161
    62         $body .= join(',', @{$_}) foreach (@problems);
     62        foreach my $problem (@problems) {
     63            $body .= join(',', @{$problem};
     64            $body .= "\n";
     65        }
    6366
    6467        my $msg = MIME::Lite->new(
Note: See TracChangeset for help on using the changeset viewer.