PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0
oci_fetch_object - Returns the next row from a query as an object
Code Examples

oci_fetch_object( resource$statement, [int$mode = OCI_ASSOC | OCI_RETURN_NULLS] ): stdClass|false

Returns an object containing the next result-set row of a query. Each attribute of the object corresponds to a column of the row. This function is typically called in a loop until it returns false, indicating no more rows exist.

For details on the data type mapping performed by the OCI8 extension, see the datatypes supported by the driver



A valid OCI8 statement identifier created by oci_parse and executed by oci_execute, or a REF CURSOR statement identifier.

Return Values

Returns an object. Each attribute of the object corresponds to a column of the row. If there are no more rows in the statement then false is returned.

Any LOB columns are returned as LOB descriptors.

DATE columns are returned as strings formatted to the current date format. The default format can be changed with Oracle environment variables such as NLS_LANG or by a previously executed ALTER SESSION SET NLS_DATE_FORMAT command.

Oracle's default, non-case sensitive column names will have uppercase attribute names. Case-sensitive column names will have attribute names using the exact column case. Use var_dump on the result object to verify the appropriate case for attribute access.

Attribute values will be null for any NULL data fields.

Related Functions

Example of oci_fetch_object

Show all examples for oci_fetch_object

PHP Version:

Function oci_fetch_object:

Oracle OCI8 Functions

Most used PHP functions