Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^6: Counting number of rows while working with Oracle

by denzil_cactus (Sexton)
on Mar 20, 2008 at 08:44 UTC ( [id://675186]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://675186]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-23 21:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found