I'm executing a cursor. I have cut off the code how the procedure is called and executed. This part is efficient. At last I have a small cursor. I'm calling the procedure, which returns this cursor many times on the page and I need to create a multidimensional array from it.
This array should look like the following:
$ret = oci_execute($outrefc) ;
while ($row = @oci_fetch_array($outrefc))
{
foreach (array_keys($row) as $key)
{
$res[$i][$key] = $row[$key];
}
$i++;
}
I have also tried like this:
oci_fetch_all($outrefc, $res, null, null, OCI_FETCHSTATEMENT_BY_ROW+OCI_NUM);
Is there any way to make the upper snippet faster? The multidimensional array should stay as it is. I only wonder if I could create it in any more efficient way.
DB query:
select code, texttext, id, text
from text,
lang,
client,
cls,
(select id, order, texttext text
from sgr, text, lang
where id = textid
and textlngid = lngid
and lngcode in ('en'))
where 1 = 1
and textcliid = cliid
and textlngid = lngid
and textclsid = clsid
and sgrid(+) = clssgrid
and nvl(showheadlinefrom, to_date('03.07.2016', 'dd.mm.yyyy')) <=
to_date('03.07.2016', 'dd.mm.yyyy')
and nvl(showheadlinetill, to_date('03.07.2016', 'dd.mm.yyyy')) >=
to_date('03.07.2016', 'dd.mm.yyyy')
and flgshowheadline in ('J')
and lngcode in ('en')
and clicode in ('mycode')
order by order;
$outrefc
? Do you use bind variables or not ? How many times you execute the query during a page load ? \$\endgroup\$