in reply to Re^5: Counting number of rows while working with Oracle
in thread Counting number of rows while working with Oracle

Here my code
my $req = <STDIN>; my $sth = $dbh->prepare( qq{ SELECT tr_code,j_trs from t_ghos } ) or die "Can't prepare statement: $DBI::errstr"; $sth->execute or die "Can't execute statement: $DBI::errstr"; my $rows = $sth->fetchall_arrayref(); my $num_rows = @$rows; if($num_rows > 0) { process($sth,$req); } sub process { my $sth = shift; my $type = shift; while (my $row = $sth->fetchrow_hashref) { next unless defined($row); } }

Now please tell me any solution to count the number of rows