Oracle doesn't have this feature so DBD::Oracle doesn't either.
This has cropped up many times before So you can blame Oracle on that. Thier logic (as it was explained to me) is

"How could you get the number of rows you are going to fetch without counting them all first?"

or someting very confusing like that.

another solution which IU have done in the past is

my $data= $c->fetchall_arrayref();

then do a Scalar($data)  to see if anything was returned.

Of course this could be heavy of resourse depending on what you are doing


----- Original Message ----- From: "Garrett, Philip (MAN-Corporate)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <dbi-users@perl.org>
Cc: <dbi-dev@perl.org>
Sent: Wednesday, April 11, 2007 10:28 AM
Subject: RE: :Oracle function


[EMAIL PROTECTED] wrote:
Anyone knows if DBD::Oracle has a function similar to the function
$sth->rows that exist in DBD::Mysql?

This is a DBI feature.  It exists for all drivers.

This function give us the number o rows in a select command. So, we
donĀ“t have to run a fetchrow with a while loop to know how many rows
the select will return.

This is driver-specific behavior. The DBI does not guarantee this. With Oracle, you will need to either (1) fetch all the rows first, or (2) change your SQL to "select count(1) from ...".

Please note that the dbi-dev list is for DBD driver authors, not general support. Please send support questions to [EMAIL PROTECTED]

- Philip

Reply via email to