in reply to DBD::CSV, SQL::Statement, and UPDATE table statement

Well, since, I'm the maintainer of all of those modules, I don't really have anywhere to pass it on to :-). Testing as we speak, I'll update when I have an answer and please /msg if you find something out in the meantime.

update1

Very, very odd. I got the same fubared results you did. But when I run the test below (which uses all the same SQL as yours), everything is copacetic. More later.
#! /usr/bin/perl -w use strict; use DBI; use FindBin; open my $fh, '>', $FindBin::Bin . '/Tanktalus'; print $fh ("DATE,NUMBER\n2005-05-16,2\n2005-05-17,4\n"); close $fh; my $dbh = DBI->connect("dbi:CSV(RaiseError=1):csv_eol=\n"); for my $sql(<DATA>){ my $sth = $dbh->prepare($sql); $sth->execute; $sth->dump_results if $sth->{NUM_OF_FIELDS}; } __END__ SELECT date,number FROM Tanktalus SELECT SUM(number) from Tanktalus UPDATE Tanktalus SET number=8 WHERE date='2005-05-17' SELECT date,number FROM Tanktalus SELECT SUM(number) from Tanktalus SELECT number FROM Tanktalus WHERE date = '2005-05-17'

update2

Ok, I can reproduce the error by using placeholders for the update in the script above. It's a SQL::Statement problem. Fix coming by morning.

update3

Ok, I found and fixed the bug in SQL::Statement. Please try grab the latest from the SVN repository and let me know if it works for you. I thanked you for the bug report in the Changes log of the distro.

Replies are listed 'Best First'.
Re^2: DBD::CSV, SQL::Statement, and UPDATE table statement
by Tanktalus (Canon) on May 18, 2005 at 21:23 UTC

    Thanks, jZed. Works much better now. Definitely wasn't a module I was expecting to get my name into ;-)

    I didn't like not using the placeholders, so I'm glad to have this fixed :-)

      Is there any schedule for getting this version into CPAN?

      I spent today tracking down another version of this bug exposed via Class::DBI and DBD::AnyData, it's nice to know that it's been fixed and that I'm not crazy (ok, at least that it's been fixed...).

      g.