in the initial sql statement
could you just add 'count'
before
my $stamt = $dbh->prepare("select  * from ab_tran");
after
my $stamt = $dbh->prepare("select  count(*) from ab_tran");

-----Original Message-----
From: Veera Prasad [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 4:17 PM
To: [EMAIL PROTECTED]
Subject: Need to Get the count of number of rows of select st without
usin g count(*)!



#!/bin/perl -w
use DBI;
my $db  = $ARGV[0];
my $rows;
my $dbh = DBI->connect( "dbi:Oracle:$db", "vprasad", "vprasad" )
        or die "Can't connect to Oracle database: $DBI::errstr\n";
my $stamt = $dbh->prepare("select  * from ab_tran");
$stamt->execute();

$rows = $stamt->fetchrow_array(); --- without using this function
print "rows: $rows\n";

$stamt->finish;
$dbh->disconnect
        or warn "Disconnection failed: $DBI::errstr\n";

Without using the function 'fetchrow_array()' , is there any better way to
get 
count of number of rows for a select st.

Regards
Veera Prasad


� 2003 OpenLink Financial 

Copyright in this message and any attachments remains with us.  It is
confidential and may be legally privileged.   If this message is not 
intended for you it must not be read, copied or used by you or 
disclosed to anyone else.   Please advise the sender immediately if 
you have received this message in error.

Although this message and any attachments are believed to be free of 
any virus or other defect that might affect any computer system into 
which it is received and opened, it is the responsibility of the 
recipient to ensure that it is virus free and no responsibility 
is accepted by Open Link Financial, Inc. for any loss or damage in any 
way arising from its use.

Reply via email to