in reply to Perl DBI and mySQL

qq{INSERT INTO mfa.genome ($cc) VALUES ("$vv")};
That will expand into something like
INSERT INTO mfa.genome (col1,col2,col3) VALUES ("val1,val2,val3")
Note that "val1,val2,val3" is ONE string value, unless the values contain special characters that break the SQL.

As hinted above, use something like

my $values = join(",",map { $dbh->quote($_) } @values); my $sql = qq{INSERT INTO mfa.genome ($cc) VALUES ($values)}

Replies are listed 'Best First'.
Re^2: Perl DBI and mySQL
by jperlq (Acolyte) on Feb 04, 2008 at 20:49 UTC
    Many thanks,
    the trick
    my $values = join(",",map { $dbh->quote($_) } @values);
    worked well.

    I will have to read up on both the ",map" part of the join statement you supplied and the $dbh->quote($_) function of DBI :)
    Thank you