wrote:
> wrote:
> > Data is stored in MySQL as '2006-07-14 13:44:13'
> >
> > Select Result from DataListing where
> > InputDate = "2006-07-14 13:44:13"
> > having count(*) > 1;
> >
This should have been:
Select Result,count(*) from DataListing where
InputDate = "2006-07-14 13:44:13"
group by Result
having count(*) > 1;
I finally fixed the problem
by putting
$SQL = "Select Result,count(*) from DataListing where
InputDate = "2006-07-14 13:44:13"
group by Result
having count(*) > 1";
my $sth = $dbh->prepare(qq{$SQL});
$sth->execute ();
instead of
my $sth = $dbh->prepare(qq{"Select Result,count(*) from DataListing
where
InputDate = "2006-07-14 13:44:13"
group by Result
having count(*) > 1"});
$sth->execute ();
> > DBD::mysql::st execute failed: You have an error in your SQL syntax;
> > check the manual that corresponds to your MySQL server version for the
> > right syntax to use near '"Select Result from DataListing where
> > InputDate = "2006-07-14 13:' at line 1 at
> > copiesinDATA.pl line 29.
>
> It would seem that your Perl quoting and your mysql quoting are somehow
> interfering with each other. As you haven't shown us any Perl, there
> isn't much we can do for you.
>
> BTW, using placeholders/bind variables often minimizes these quoting
> problems.
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service $9.95/Month 30GB