Re: Recurse gives me No more handles



On Tue, 2009-01-20 at 11:39 -0600, Don.Walters@xxxxxxxxxxxxx wrote:
I am running DB2 v9 on AIX 5.3.0.0 with perl 5.8.2 and I'm having a
problem with a recursive script which is shown below.


Could you replace the recursion with a loop?

sub Recursion {
my $sth_leaf;
$parentcoid = shift;
$boname = shift;

my @params = ( [ $parentcoid, $boname ] );

while ( my $param = shift @params ) {
$parentcoid = $param->[0];
$boname = $param->[1];

$sth_leaf = $db2->prepare( "SELECT hex(COID_REF),CONAME,DCP_UNIQUE_ID FROM SA.EXT WHERE COID=x'$parentcoid' ORDER BY CONAME");
$sth_leaf->execute();
while ( ( $coref, $coname, $uniqueid ) = $sth_leaf->fetchrow_array() ) {
if ( $coname =~ /AF/ ) {
push @af, qq($coref++$boname++AF);
}
elsif ( $coname =~ /ST/ ) {
push @st, qq($coref++$boname++ST);
}
elsif ( $coname =~ /EQ/ ) {
push @eq, qq($coref++$boname++EQ);
}
else {
push @sa, qq($coref++$boname++SA);

# &Recursion( $coref, $boname );
push @params, [ $coref, $boname ];
}
}
}
}


--
Just my 0.00000002 million dollars worth,
Shawn

Programming is as much about organization and communication
as it is about coding.

"It would appear that we have reached the limits of what it is
possible to achieve with computer technology, although one should
be careful with such statements, as they tend to sound pretty silly
in 5 years."
--John von Neumann, circa 1950

.