|No such thing as a small change|
DBD::ODBC insert first line, but not line 2by ksublondie (Friar)
|on Oct 06, 2015 at 18:05 UTC||Need Help??|
ksublondie has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on an automated script with perl 5.20 on win server 2012r2, 64-bit that will import a csv file to a sql 2008 db. Here's the code snippet:
and the resulting log output:
The email says:
So it's inserting line 1, but failing on line 2. Although the content is different between line 1 & line 2, the format and length is essentially identical. If I copy/paste the command and values into management studio, the command succeeds.
Any ideas why line 1 inserts, but crashes on line 2?
UPDATE: I have modified my input file a few times, playing with the line order (ie, copy/paste line 1 so lines 1 & 2 are identical data, cut/paste line 1 down in the file, etc). No matter the data, line 1 imports, but line 2 always fails. Since it's a server 2012 box, could it be a driver issue perhaps???
UPDATE 2: I moved the $db->prepare statement from before the while loop to inside the while loop and it works. ...Of course, this defeats the purpose of prepare and execute which I've been able to do successfully in the past. Really looking like a driver issue at this point.