-----Original Message-----
From: Orlando Andico
To: Sterin, Ilya
Cc: 'Philip Mak '; 'Steven Lembark '; ''[EMAIL PROTECTED] ' '
Sent: 06/26/2001 8:50 AM
Subject: RE: Shorthand for $dbh->prepare and $sth->execute?

On Tue, 26 Jun 2001, Sterin, Ilya wrote:
..
> Right.  The first will fetch all rows, where the second can be stopped
at
> any time.
..
> versus:
>
> $sth = $dbh->prepare("SELECT ...");
> $sth->execute;
> while ($row = $sth->fetchrow_hashref) {
>   do something with $row
> }

>This may be true, but as I understand it (vaguely), in Oracle, when you
>do
>the execute it (by default) runs the query through and fetches all the
>rows.  Although this behavior can be changed using an optimizer hint
>("return rows as quickly as possible") which I forgot right now..

>I'm not sure if this is correct, btw. It's just that I've noticed when
>you
>do large SELECTs in Oracle, the execute takes forever. When the execute
>completes, a torrent of data comes in. So my conclusion that Oracle
>executes the whole query first..

Hmmm.  I wonder than why rows() doesn't work (in my case) until everything
is fetched?  You are probably right, that you can optimize it's operation.

Ilya


-- 
Orlando Andico <[EMAIL PROTECTED]>
Mosaic Communications, Inc.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GE d(-) s: a-25 C++++ UBLSI++++$ P+++ L+++>++++ E- W++ N(+)
o K? w O-- M- !V PS(++) PE- Y PGP-- t(+)@ 5(+) X++@ R(+) tv@
b++ DI++ G e++@ h--(*) r% y+
------END GEEK CODE BLOCK------

Reply via email to