php-db | 2000121
Date: 12/02/00
- Next message: Howard Sanders: "[PHP-DB] Creating Tables"
- Previous message: Dave Fudge: "RE: [PHP-DB] oracle8"
- In reply to: Dave Fudge: "RE: [PHP-DB] oracle8"
- Next in thread: Tim Parkin: "RE: [PHP-DB] oracle8"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dave Fudge wrote:
>
> ammendment,
> is there a way to get both OCIFetchSTatement and OCIFetchInto
> without using OCIExecute() twice?
>
No, but after doing OCIFetchStatement() you have the complete resultset
stuffed into an array where you can access it. The return value of
OCIFetchStatement() indicates the number of rows found, this might be
helpful for your second question. But be aware that OCIFetchStatement()
can take huge amounts of memory, depending on your resultset data, so
there are cases where it would be better not to use it but get the
results row by row.
> part 2:
> is there an easier way than using $i=0
>
> while (OCIFetchInto($sth,&$row,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS))
> {
> $i = $i+1;
> }
>
> to find the number of rows affected by a select?
>
> apparently OCIRowCount won't work.
If you absolutely need the number of rows in a select, consider doing
first a "select count() as numrows ..." to get the desired information
without fetching a possibly huge resultset.
I've found that in 99,9% it is perfectly possible to live without
knowing the number of rows in a result set. If you want to limit the
number of rows returned, use the pseudocolumn ROWNUM (see Oracle SQL
docs).
HTH,
Andreas
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Howard Sanders: "[PHP-DB] Creating Tables"
- Previous message: Dave Fudge: "RE: [PHP-DB] oracle8"
- In reply to: Dave Fudge: "RE: [PHP-DB] oracle8"
- Next in thread: Tim Parkin: "RE: [PHP-DB] oracle8"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

