Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What is the best way to pull back data from a CLOB field via PHP OCI8?

firstaspect96623234234Apr 15 2014 — edited Apr 16 2014

Hi,

I'm wanting to pull back data from an Oracle 11g database, part of which involves a CLOB field. I'm currently using the following:

while (($row = oci_fetch_array($sqlresult, OCI_ASSOC + OCI_RETURN_NULLS+OCI_RETURN_LOBS)) != false) { .....

on a parsed and executed statement to put the results into a PHP array. However it is very slow. For a query that only returns 10 rows, with one CLOB field containg around 5000 characters of data, it takes 5-6 seconds to run.

If I instead use a VARCHAR2 field with the full 4000 characters it runs in well under a second, as expected.

Am I doing something wrong? Or are CLOBS really that slow via OCI8.

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 14 2014
Added on Apr 15 2014
2 comments
1,883 views