in reply to DBI Quoting question
The best is to use the prepare method with placeholders:
This has the benefit of taking care of the quoting for you, but also of adding a performance increase, as just having to prepare the query once will save some time, as opposed to the DBI 'do' subroutine, which has to prepare it each time.my $sth = $dbh->prepare("INSERT INTO whatever VALUES(?, ?, ?, ?, ?, ?, + ?, ?, ?, ?, ?, ?, ?, ?)") while (<INFILE>) { my @line = (parse_csv ($_)); $sth->execute(@line); }
|
---|
In Section
Seekers of Perl Wisdom