http://www.perlmonks.org?node_id=1089635

PrincessofPERL has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, This is my first post here. I have been lurking many of the discussions on this site and YES I have searched this site, GOOGLE, etc. for hours on hints on how to solve my problem. I hope to be expert level some day and give back to the PERL community. I've been spinning the wheels on this problem. Here is my error message. The referenced file is located in the same directory as my Perl script.
D:\...>afs_filter.pl 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 . [for Statement "select * from AFS where ID_DEVTYP like 'INTELI%' AND +ID_POINT like 'AUTO%'"] at D:\...\afs_filter.pl line 53. DBD::CSV::st fetchrow_hashref failed: Attempt to fetch row without a p +receeding execute () call or from a non-SELECT sta tement [for Statement "select * from AFS where ID_DEVTYP like 'INTELI% +' AND ID_POINT like 'AUTO%'"] at D:\...\afs_filter.pl line 60.
Version - Which Cannot Be Updated/Modified, it HAS to stay the same :(
This is perl, v5.10.1 built for MSWin32-x64-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1007 [291969] provided by ActiveState http://www.ActiveSt +ate.com Built Jan 27 2010 14:12:21
Here is My Code
use warnings; use strict; use DBI; # Create connection string to database point.csv (output file from sca +daexport.pl) my $dbh = DBI->connect ("dbi:CSV:csv_auto_diag=1", { f_dir => ".", f_ext => ".csv/r", f_enc => "utf-8", file => "point.csv", }); # Associate our csv file with the table name "AFS" and include custom +column names $dbh->{csv_tables}->{AFS} = { file => "point.csv", col_names => [qw( RECORD SUBSCRIPT ID_SUBSTN CO_SUBSTN AREA_SUBS +TN ID_DEVTYP ID_DEVICE NAME_DEVICE AREA_DEVICE ID_MEAS ID_POINT SITE_ +POINT AREA_POINT )], }; # 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;
I do not feel comfortable posting the sensitive file contents of point.csv but can give you the format with data replaced by letters
RECORD,SUBSCRIPT,ID_SUBSTN,CO_SUBSTN,AREA_SUBSTN,ID_DEVTYP,ID_DEVICE,N +AME_DEVICE,AREA_DEVICE,ID_MEAS,ID_POINT,SITE_POINT,AREA_POINT a,b,c,d,e,f,g,h,i,j,k,l,m . .
I would appreciate any specific/detailed guidance or code to try/correct the issue.