in reply to How to optimise " csv into mysql " using Text:CSV_XS and DBD::Mysql
my $query = qq{INSERT INTO some_table (id,$fieldList) VALUES (id,$field_placeholders)};
Side comment: Dynamic SQL is not secure. Admittedly, this one is more interesting in that it actually uses placeholders, but, building the placeholders string kind of defeats the purpose. That is, there's a benefit that strings need not be escaped and there will be strong typing, but the statement is no more secure.
If you're just doing an import, mysql supports it directly with LOAD DATA INFILE.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to optimise " csv into mysql " using Text:CSV_XS and DBD::Mysql
by Your Mother (Archbishop) on Aug 06, 2015 at 13:48 UTC | |
by chacham (Prior) on Aug 06, 2015 at 14:38 UTC | |
by Your Mother (Archbishop) on Aug 06, 2015 at 15:33 UTC | |
by chacham (Prior) on Aug 06, 2015 at 16:29 UTC | |
by taiko (Sexton) on Sep 04, 2015 at 22:09 UTC | |
|