PrincessofPERL has asked for the wisdom of the Perl Monks concerning the following question:
Version - Which Cannot Be Updated/Modified, it HAS to stay the same :(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.
Here is My CodeThis 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
I do not feel comfortable posting the sensitive file contents of point.csv but can give you the format with data replaced by lettersuse 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 would appreciate any specific/detailed guidance or code to try/correct the issue.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 . .
|
|---|