[Bioperl-l] Trying to get a mysql DB from genbank flat files
Wilfred Li, Ph.D.
wilfred@SDSC.EDU
Thu, 15 Nov 2001 09:41:13 -0800
>thanks for your mail, you have magically bumped into our daily nightmare,
>that is that very often people put crazy characters in the description
>lines, and we have to find ways of backslashing all of them otherwise
>they will break mysql statements. Could you mail me the offending record?
Hi,
If bind variables are used in place of a plain insert statement, many of
the special characters will be taken care of by perl DBI. e.g.
$sth->prepare("insert ... values (?, ..., ?)");
$sth->execute($id, ..., $kw);
or use
$dbh->do("insert ... values (?, ..., ?)", $id, ..., $kw);
to combine the two steps into one.
I had the problem with SeqAdaptor.pm when parsing SwissProt.
Wilfred