my $sth = $dbh->prepare("Select a, b from t1") or die "..."; $sth->execute or die "..."; while (my $row = $sth->fetchrow_arrayref) { my $cursor = $dbh->prepare("select d, e from t2 where k = ?"); $cursor->execute($row->[1]); # t1.b .... } #### ------------ :Wq Not an editor command: Wq