### Perform the connection using the Informix driver my $dbh = DBI->connect( "dbi:Informix:nps\@sumitt_aaa","netsite","Ppol0699" ,\%attr )or die "Can't connect to database: ", $DBI::errstr, "\n"; $sth=$dbh->prepare("select det_number,det_ccode,head_date from podetail a,pohead er b where det_number=head_number and head_date>'2002/01/01'"); $sth->execute(); # will dump out all fields $data=$sth->dump_results(); #$data=$sth->dump_results(); while ( ($po, $ccode,$head_date) = $sth->fetchrow_array() ){ #print " $po $ccode, $head_date \n"; push (@po,$po); } $sth->finish; $p_str=@po; print "# of POs: $p_str \n"; *********TAKES WAY TOO LONG IN HERE ****************** foreach $po(@po) { for ($count=0; $count<=$i;$count++) { $sth=$dbh->prepare("select det_number from podetail a, poheader b where det_ccode=? and head_date>'2002/01/01' and det_number=?"); #print "old cc: $old[$count], PO checked: $po \n"; $sth->execute($old[$count],$po); $p_str=$sth->fetchrow_array(); if ($p_str) { push (@p_str,$p_str); print "$p_str \n"; } $sth->finish; } } *******************************