in reply to Re^6: How to optimise " csv into mysql " using Text:CSV_XS and DBD::Mysql
in thread How to optimise " csv into mysql " using Text:CSV_XS and DBD::Mysql

The (major) reason placeholders are better than variables in a dynamic SQl statement, is placeholders are strictly typed and cannot (generally) do anything unintended.

In the script, $fieldList defines the list of fields. As there is now a variable available in the statement, little Bobby Tables lives on.

The idea is to never have a variable anywhere in your SQL statements.

Ultimately, it's just fyi. Keep it in mind and make the best decision for your particular situation.

  • Comment on Re^7: How to optimise " csv into mysql " using Text:CSV_XS and DBD::Mysql