CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
DBD::CSV::st execute failed

 



thatbradguy
New User

Oct 26, 2011, 8:50 AM

Post #1 of 3 (853 views)
DBD::CSV::st execute failed Can't Post

Having trouble with a script that isn't reading a CSV log properly. The error I get is as follows:

Quote
DBD::CSV::st execute failed: Can't call method "column" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/SQL/Statement/Term.pm line 199, <GEN32> line 102.
[for Statement "SELECT email, max(timestamp) AS timestamp FROM log WHERE email = 'janedoe@yahoo.com' GROUP BY email"] at /home/username/emailservice/send.pl line 44.


An excerpt of "log" is as follows:

Quote
timestamp,firstname,lastname,email,emaildate
1318866343,David,Doe,dcdoe@cox.net,2011-10-17
1318866343,"Robert & Robbie",doe,robert.doe@domain.mil,2011-10-17


The object of the query is to return the most recent time that email address appears in the log. Thanks for any help!


(This post was edited by thatbradguy on Oct 26, 2011, 9:00 AM)


FishMonger
Veteran / Moderator

Oct 26, 2011, 9:36 AM

Post #2 of 3 (846 views)
Re: [thatbradguy] DBD::CSV::st execute failed [In reply to] Can't Post

You need to show us the relevant code in your script and line 102 of the file it's processing.


thatbradguy
New User

Oct 26, 2011, 9:46 AM

Post #3 of 3 (842 views)
Re: [FishMonger] DBD::CSV::st execute failed [In reply to] Can't Post

Line 102 of log which is the file being processed is:

Quote
1319205606,"Steven & Susan",Aker,janedoe@yahoo.com,2011-10-21


"janedoe@yahoo.com" is the same email address that is in the query that seems to be failing.

Lines 42-44 in send.pl are:

Code
my $query = "SELECT email, max(timestamp) AS timestamp FROM $table WHERE email = ". $dbh->quote ($emailaddress)." GROUP BY email"; 
my $sth = $dbh->prepare ($query);
$sth->execute ();


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives