hello , i am a new perl programmer and i work in a nested loops that each lop 
excutes an sql to get a result ( 1 - M )relationship. but i faced problem: that 
i must finish the excute the parent sql before continuing fetching the childs 
results.
sql format:
-------------------------------
 my ($sql)=qq
    {
             SELECT $fields
             FROM $tables
             WHERE $condition
             ORDER BY $OB DESC
     };
 
  my ($sth)=$dbh->prepare($sql);
 $sth->execute() || bail_out("Connt prepare retrive accounts query");
    while(@arr1=$sth->fetchrow_array())
    {
     push(@result,[EMAIL PROTECTED]);
        #=================
             my ($sql_2)=qq
      {
             SELECT $fields
             FROM $tables
             WHERE $condition depending on the parent specific result
             ORDER BY $OB DESC
     };
 
         my ($sth_2)=$dbh->prepare($sql_2);
          $sth_2->execute() || bail_out("Connt prepare retrive accounts query");
          
          while(@arr2=$sth_2->fetchrow_array()) 
                 {

                push(@result2,[EMAIL PROTECTED]);   }
          $sth_2->finish();
       #====================
    }
    $sth->finish();
    return @result;
 
 
#============
my regards
Dakka, Rami




                
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 

Reply via email to