When you print $ins_rec to your screen what do you get? Could you post the exact output of printing $ins_rec?
You should be using placeholders. Use DBI, prepare the statement, and then execute it by including the bind values as $sth->execute() bind params.
What I expect to find when you show us the contents of $ins_rec is something in your big string full of interpolation sending an unescaped metacharacter to MySQL that corrupts the SQL query statement. That, along with the potential for intentional SQL injection attacks is why Placeholders and Bind Values exist (well, efficiency and convenience too).
Per your OP update: I realize you're using DBI, but you may not be using it safely. You have to either use DBI's quote() method on the data you're instering, or you rework your prepare() to use placeholders, and your execute() to provide the bind values.
Dave
In reply to Re: MySQL INSERT in Perl
by davido
in thread MySQL INSERT in Perl
by baperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |