in reply to DBD::CSV, SQL::Statement, and UPDATE table statement
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 | |
by hartzell (Sexton) on Jul 07, 2005 at 05:03 UTC |