Forum Stats

  • 3,824,762 Users
  • 2,260,415 Discussions
  • 7,896,308 Comments

Discussions

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

firstaspect96623234234
firstaspect96623234234 Member Posts: 2
edited Apr 16, 2014 3:38AM in PHP

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.

Answers

This discussion has been closed.