Help for this page

Select Code to Download


  1. or download this
    DBD::CSV::st execute failed:
    Execution ERROR: Cannot open afs: No such file or directory at C:/Perl
    +64/lib/DBD/File.pm line 565
    
  2. or download this
    # Create connection string to database point.csv (output file from sca
    +daexport.pl)
    my $dbh = DBI->connect ("dbi:CSV:csv_auto_diag=1", {
    ...
    # Define and Execute SQL to select INTELI and AUTO points
    my $sth = $dbh->prepare ("select * from AFS where ID_DEVTYP like 'INTE
    +LI%' AND ID_POINT like 'AUTO%'");
    $sth->execute;
    
  3. or download this
    my @col = qw(RECORD SUBSCRIPT ID_SUBSTN CO_SUBSTN AREA_SUBSTN ID_DEVTY
    +P ID_DEVICE NAME_DEVICE AREA_DEVICE ID_MEAS ID_POINT SITE_POINT AREA_
    +POINT);
    my $cols = join ",",@col;
    ...
    
    my $sth = $dbh->prepare ("SELECT $cols FROM point WHERE ID_DEVTYP LIKE
    + 'INTELI%' AND ID_POINT  LIKE 'AUTO%'");
    $sth->execute;
    
  4. or download this
    my @col = qw(RECORD SUBSCRIPT ID_SUBSTN CO_SUBSTN AREA_SUBSTN ID_DEVTY
    +P ID_DEVICE NAME_DEVICE AREA_DEVICE ID_MEAS ID_POINT SITE_POINT AREA_
    +POINT);
    my $cols = join ",",@col;
    ...
    # Define and Execute SQL to select INTELI and AUTO points
    my $sth = $dbh->prepare ("select $cols from point.csv where ID_DEVTYP 
    +like 'INTELI%' AND ID_POINT like 'AUTO%'");
    $sth->execute;
    
  5. or download this
    use warnings;
    use strict;
    ...
    # Close file    
    close DAT_OUTPUT;