in reply to SOLVED: DBI Problem

Did you create your database handle with RaiseError => 1 ?

Otherwise, DBI has very little in ways of communicating to you what might be going wrong.

I don't really see why/where your INSERT statement would go wrong, but maybe it has something to do with the credentials you use in your Perl script as opposed tothe credentials of whatever other tool you use.

Replies are listed 'Best First'.
Re^2: DBI Problem
by Zarquav (Novice) on Jan 29, 2018 at 19:50 UTC
    Yes, I did. Here's the DBI connect line:
    my $dbHandle = DBI->connect($dbSource, $dbUserName, $dbPassword, {Rais +eError => 1, AutoCommit => 0});
    As for credentials, I'm connecting to the DB both in code and through the SQL console with 'root' user.. So unless there's some other specific credentials being used by the SQL console.... But.. if it was a credentials issue, shouldn't DBI be returning an error, not suggesting that 1 row was affected?

      AutoCommit => 0

      means you have to explicitly call $dbh->commit or your changes will be rolled back.

        Yes! Thank you! I should've seen that sooner.. But I guess I figured that was fine because other queries have worked..

        Now my new question is, how did it ever work for my previous calls?

        Previously, I was running a script that did Create tables statements and Insert Statements.

        I had to put the Insert statements first or I had the same problem..

        So does that mean Create table statements force a commit to the DB even if Autocommit is 0 and I never explicitly called commit?