On Mon, Apr 14, 2008 at 10:35 PM, Pat Rice <[EMAIL PROTECTED]> wrote:
> Hi all > I'm looking for some good ideas on trouble shooting SQL. > > as in I have wrote thsi code, but I wondering if there is any way we > can a debug level, so that it would tell me if the query failed. > eg. > my $sql = q/SELECT Account,Last_Name,First_Name,Email_Address FROM > prospects WHERE Email_Address='?'/; > > follow this you could try: my $sth = $dbh->prepare($sql); # I think this works fine for your statement $sth->execute($email) or die $dbh->errstr; # execute it $dbh->errstr will show you what's wrong in the execution. Good luck.