gojira has asked for the wisdom of the Perl Monks concerning the following question:
I am programming perl for a while now but mysql, and the combination of perl with mysql is very new to me. I wrote a perl script that is supposed to do kmedoids-clustering of several thousand promoters (human genome).
Many instances of this script are running on a Grid Engine cluster. When I run this script with a random selection of a few hundred promoters only, everything works fine.
But now I tried to cluster the full dataset of several thousand promoters and get this error:
"DBD::mysql::st fetchrow_array failed: fetch() without execute() at chipchip.pl line 144, <L3> line 14446. "Here is the part of my script where it happens, I think:
foreach $item (@{$clusters}) { $ID = $units[$i][0]; $query = "select * from finalLevel3 where id=\"$ID\";"; $sth = $dbh -> prepare($query); $sth -> execute; @row = $sth -> fetchrow_array; # convert the mysql result back to a string again $promoter_line = join "\t", @row; $promoter_line .= "\n"; $parser_hash{$item} .= $promoter_line; $i++; }
I found a thread in this forum which I think is a very similar problem and the solution, however I must say that I simply don't understand how to solve this and what's going on. That thread is node 729564. I'm happy that this problem seems already to be solved but I simply don't understand the solution - a more verbose explanation would be very, very much appreciated.
Do I need two separate $dbh - handles? If yes do I need to connect them separatedly?
I would be very thankful if someone could explain to me how to fix this. Also, the thing is that this error only shows up if I do the clustering on the whole dataset (2 days runtime on Grid Engine), so it would be superduper cool if I could get it right the first or second time because it takes so long to reproduce the error. Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl, mysql: "fetchrow_array failed: fetch() without execute()"
by ikegami (Patriarch) on Dec 29, 2008 at 06:13 UTC | |
by Marshall (Canon) on Dec 29, 2008 at 09:57 UTC | |
by ikegami (Patriarch) on Dec 29, 2008 at 10:18 UTC | |
by Marshall (Canon) on Dec 29, 2008 at 13:46 UTC | |
by DStaal (Chaplain) on Dec 29, 2008 at 14:26 UTC | |
by runrig (Abbot) on Dec 29, 2008 at 17:01 UTC | |
|
Re: perl, mysql: "fetchrow_array failed: fetch() without execute()"
by runrig (Abbot) on Dec 29, 2008 at 06:11 UTC |