in reply to DBD ERROR: error possibly near <*> indicator at char
Look at the error message: The last parameter has whitespace (the newline character) appended. It is there because perl does not auto-chomp while reading from a file, you have to do it. Just add a chomp; as first statement in your while loop.
Note that your code is not very efficient: prepare the statement outside the loop, execute it for each loop run, and finish it after the loop. The eval-commit-construction actually just compensates your explicit AutoCommit => 0 in connect(), so remove one. If you want to commit either all or nothing, wrap the entire while loop in an eval, move the commit behind the loop, still inside the eval, and issue a rollback if eval throws an exception.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBD ERROR: error possibly near <*> indicator at char
by tweetiepooh (Hermit) on Mar 25, 2009 at 10:27 UTC | |
|
Re^2: DBD ERROR: error possibly near <*> indicator at char
by suhailck (Friar) on Mar 25, 2009 at 08:52 UTC | |
|
Re^2: DBD ERROR: error possibly near <*> indicator at char
by Anonymous Monk on Oct 14, 2017 at 16:11 UTC | |
by roboticus (Chancellor) on Oct 14, 2017 at 16:32 UTC |