in reply to Re: Recursive dbh executions
in thread Recursive dbh executions

I agree. As has been noted, the problem is that inside that while, you are in the middle of reading the results coming back. If you think of it at the database level, if you were working in an SQL tool and typing queries to get results, you type one query, execute, and get all the rows back. There isn't a way in mid-result fetching to run another query.

There are ways to script things with more advanced SQL, but that can get hairy. Unless you have a memory limitation on your system, it's much easier and cleaner to pull in a full data structure, then work on that.

Replies are listed 'Best First'.
Re^3: Recursive dbh executions
by dragonchild (Archbishop) on Mar 23, 2005 at 18:17 UTC
    It's not quite that simple. Some DBD's, such as Oracle and MySQL, can have multiple statements executing at the same time. Others, such as Sybase / SQL*Server, cannot. But, most DBD's won't let you do the same statement twice at the same time. That's the issue here.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.