Help for this page

Select Code to Download


  1. or download this
    while(my $line = <INFILE> ) {
        $csv->parse($line);
        my ( $state,$city,$location ) = $csv->fields();  # assumming these
    + are col1,col2,col3
        $sth->execute($state,$city,$location) or die "Couldn't execute que
    +ry: $dbh->errstr";
    }
    
  2. or download this
    my $sql =<<SQL;
    LOAD DATA LOCAL INFILE '$infile' 
    ...
    SQL
    
    $dbh->do($sql);