【发布时间】:2016-10-30 15:47:15
【问题描述】:
我收到了这个错误
DBD::mysql::st execute failed: called with 181 bind variables when 172 are needed at line 110, <$fh> line 1.
我认为问题出在这部分代码
while ( my $row = <$fh> ) {
chomp $row;
my @DNA = split('\|', $row);
my $participant_id = $DNA[0];
$participant_id =~ s/\>//g;
my $array = $DNA[1];
my $length = length $array;
$array =~ tr/a-z/A-Z/;
$array =~ s/(...)/$1 /g;
$array =~ s/\s+/,/g;
my @DNA1 = split (',', $array);
unshift @DNA1, $participant_id;
$sth4->execute(@DNA1); # Line 110
}
$sth4->finish;
【问题讨论】:
-
有用的错误信息。您的
@DNA的列数比相应的 SQL 语句所知道的要多。查找 SQL 语句的定义位置(在代码中进一步查找 $sth4),看看您是否能弄清楚该做什么。您可能需要更改 SQL 以适应您的数据大小。 -
您可以通过打开跟踪查看它尝试运行的 SQL:stackoverflow.com/questions/5885561/…
-
谢谢@xxfelixxx,这给了我继续前进的动力。
标签: mysql perl bioinformatics