| Article: |
Relational Modeling of Biological Data: Trees and Graphs | |
| Subject: | fetch() without execute() error in Example 1 | |
| Date: | 2003-06-14 16:24:32 | |
| From: | gee | |
|
I've been looking most of the day for a script like the one in Example 1 (converting adjacency list to nested set) to fix a mysql table that I fubared this morning.
|
||
Showing messages 1 through 3 of 3.
-
fetch() without execute() error in Example 1
2003-06-15 11:49:37 anonymous2 [View]
-
fetch() without execute() error in Example 1
2004-01-11 11:31:44 anonymous2 [View]
It took several days(more than a week) on a pentium-4 freebsd machine to run this code for entire ncbi taxonomy. Is there anything I should check with my MySql or table structure? I have indexed the taxon_id and the parent_id. -
fetch() without execute() error in Example 1
2006-02-06 10:55:01 Aaron Mackey | [View]
The$childrenstatement needs an additional clause, as follows:
my $children = $dbh->prepare("SELECT id
FROM taxon
WHERE parent_id = ?
AND id <> parent_id");



In the script, replace the following line:
while(my ($id) = $children->fetchrow_array) {
With this:
for my $row (@{$children->fetchall_arrayref}) {
my ($id) = @$row;
Thanks, Aaron!