★ wanayoo — archive 1999 http://www.php.net/manual/function.ocirowcount.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to OCI8
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
OCI8
* OCIDefineByName
* OCIBindByName
* OCILogon
* OCIPLogon
* OCINLogon
* OCILogOff
* OCIExecute
* OCICommit
* OCIRollback
* OCINewDescriptor
* OCIRowCount
* OCINumCols
* OCIResult
* OCIFetch
* OCIFetchInto
* OCIFetchStatement
* OCIColumnIsNULL
* OCIColumnSize
* OCIServerVersion
* OCIStatementType
* OCINewCursor
* OCIFreeStatement
* OCIFreeCursor
* OCIColumnName
* OCIColumnType
* OCIParse
* OCIError
* OCIInternalDebug
Manual: OCIRowCount
View the source code for this pageSearch the site



Previous page
 OCINewDescriptor
 Updated
Sat, 12 Aug 2000
OCINumCols 
Next page


OCIRowCount

(unknown)

OCIRowCount -- Gets the number of affected rows

Description

int OCIRowCount (int statement)

OCIRowCount() returns the number of rows affected for eg update-statements. This funtions will not tell you the number of rows that a select will return!

Example 1. OCIRowCount


<?php
    print "<HTML><PRE>";
    $conn = OCILogon("scott","tiger");
    $stmt = OCIParse($conn,"create table emp2 as select * from emp");
    OCIExecute($stmt);
    print OCIRowCount($stmt) . " rows inserted.<BR>";
    OCIFreeStatement($stmt);
    $stmt = OCIParse($conn,"delete from emp2");
    OCIExecute($stmt);
    print OCIRowCount($stmt) . " rows deleted.<BR>";
    OCICommit($conn);
    OCIFreeStatement($stmt);
    $stmt = OCIParse($conn,"drop table emp2");
    OCIExecute($stmt);
    OCIFreeStatement($stmt);
    OCILogOff($conn);
    print "</PRE></HTML>";
?> 


User Contributed Notes: OCIRowCount


slnwj@cc.usu.edu
17-Nov-1999 05:37
Can this function be used to find the number of rows selected?


jeremy@prsx.net
29-Jan-2000 08:30
Stupid question time. Is there an equivalent OCI func to getting the number of rows returned from a select query? I've browsed through the documentation, and apparently I'm missing something.


jeremy@prsx.net
29-Jan-2000 08:56
ignore the above question. You can't do it for performance reasons within the database.


batti@digito.com
16-Feb-2000 08:52
this function can be used with select statement, and also return affected number of rows.
But remember this, use this after fetch statement.



mikes@networqs.net1
03-Mar-2000 04:18
ok so this doesnt return the # of rows from a select.
so what does?!



andrew@ugh.net.au
13-Apr-2000 12:12
Try OCIFetchStatemnet if you want to know how many rows were returned by SELECT. Seems you have to load them all into memory this way though. If you only want to know how many lines are selected you can always SELECT COUNT()


 About Notes


Previous page
 OCINewDescriptor
 Updated
Sat, 12 Aug 2000
OCINumCols 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.