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.

In reply to DBD::CSV::st execute failed. No such file or directory at C:/Perl64/lib/DBD/File.pm line 565 by PrincessofPERL

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.