in reply to Strange Execute Issue from PERL

What else do you expect?

As an idea, consider changing your code to:

... $rv = $sth->execute ##Insert into production Metar table. or die "can't execute the query: " . $sth->errstr; # ^^^^^^^

That way, you'll see what your DBD things is the error cause and what it gives you as error message.

Replies are listed 'Best First'.
Re^2: Strange Execute Issue from PERL
by LHowell (Initiate) on May 07, 2011 at 21:27 UTC
    I can not see what it is taht you are suggesting that I change my code to. It isn't being displayed in the reply!

      You currently have:

      $rv = $sth->execute or die "can't execute the query: $sth->errstr";

      I suggest that you change it into

      $rv = $sth->execute or die "can't execute the query: " . $sth->errstr;

      ... so that you see the actual error message from your database driver.

      If you look at the error message you got until now, you see DBI:: st=HASH(0x1a07924)-> errstr in there, which is much less informative than the actual return value of ->errstr.

        I made the change as follows: $sth = $dbh->prepare($InsertIntoMetar) or die "can't execute the query: " . $sth->errstr; I got the same result as before! I'm thinking that this has to be do some "user" or "pass" issue but that doesn't seem possible since I "prepare" and "execute make statements against tables in this database in the same script prior to the one that is causing me trouble. I create tables "Like" metar numerous times and do many "alters" and "drops". This is the first time I actually try to update "metar" though! Hope this helps! I am sure this is going to turn out to be something that is going to make me look VERY silly! Thoughts?