PHP Function OCI_Fetch_Object
The php function oci_fetch_object fetches rows of result data into a two-dimensional array. The row numbers are based on the position of the first column in the query's result set. The array contains everything as strings except for LOBs and FILEs, where the column names are converted to upper case. If you need to get a certain part of a FILE or LOB, use OCI-Lob::seek().
The statement identifier is returned, which you can use with oci_bind_by_name() and oci_execute(). You should free this identifier with oci_free_statement() after using it. This function does not validate the sql_text, so you should use oci_parse() to check whether it's an SQL or PL/SQL statement before executing it.
Queries that return a lot of rows can be more memory efficient if you use oci_fetch_array() instead of oci_fetch_row(). This function uses less memory, and it returns the row data as objects whose attributes correspond to the fields of the SQL or PL/SQL statement.
To use this function, you need to have the Oracle Instant Client and the PHP OCI8 extension installed on your system. You can download both of these from the PECL website and extract them to a directory on your server. You should then add the directory to your system's PATH environment variable and restart your web server. Then you can start coding with the OCI8 library. The tutorials and examples on this site will help you learn how to do this efficiently. We also have a Code Practice section for you to try out the syntax and concepts that are discussed in this article.