<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.oci8.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.oci-set-prefetch-lob.php',
    1 => 'oci_set_prefetch_lob',
    2 => 'Sets the amount of data prefetched for each CLOB or BLOB.',
  ),
  'up' => 
  array (
    0 => 'ref.oci8.php',
    1 => 'OCI8 Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.oci-set-prefetch.php',
    1 => 'oci_set_prefetch',
  ),
  'next' => 
  array (
    0 => 'function.oci-statement-type.php',
    1 => 'oci_statement_type',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/oci8/functions/oci-set-prefetch-lob.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.oci-set-prefetch-lob" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">oci_set_prefetch_lob</h1>
  <p class="verinfo">(PHP 8.2, PECL OCI8 &gt;= 3.2)</p><p class="refpurpose"><span class="refname">oci_set_prefetch_lob</span> &mdash; <span class="dc-title">Sets the amount of data prefetched for each CLOB or BLOB.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.oci-set-prefetch-lob-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>oci_set_prefetch_lob</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$statement</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$prefetch_lob_size</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Sets the internal buffer size used to fetch each CLOB or BLOB value when the
   implementation gets the internal Oracle LOB locator from the database after
   a successful query call to <span class="function"><a href="function.oci-execute.php" class="function">oci_execute()</a></span> and for each
   subsequent internal fetch request to the database.  Increasing this value
   can improve the performance of fetching smaller LOBs by reducing round-trips
   between PHP and the database.  Memory usage will change.
  </p>
  <p class="para">
   The value affects LOBs returned as OCILob instances and also those returned
   using <strong><code><a href="oci8.constants.php#constant.oci-return-lobs">OCI_RETURN_LOBS</a></code></strong>.
  </p>
  <p class="para">
   Call <span class="function"><strong>oci_set_prefetch_lob()</strong></span> before
   calling <span class="function"><a href="function.oci-execute.php" class="function">oci_execute()</a></span>.  If it is not called, the value
   of <a href="oci8.configuration.php#ini.oci8.prefetch-lob-size" class="link">oci8.prefetch_lob_size</a>
   is used.
  </p>
  <p class="para">
   The LOB prefetch value should only be set with Oracle Database 12.2 or later.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-set-prefetch-lob-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">statement</code></dt>
     <dd>
       <p class="para">Der Identifizierer eines
gültigen OCI8-Ausdrucks, der von <span class="function"><a href="function.oci-parse.php" class="function">oci_parse()</a></span> erzeugt
und von <span class="function"><a href="function.oci-execute.php" class="function">oci_execute()</a></span> oder einem <code class="literal">REF
CURSOR</code>-Ausdruck verwendet wird.</p>
     </dd>
    
    
     <dt><code class="parameter">prefetch_lob_size</code></dt>
     <dd>
      <p class="para">
       The number of bytes of each LOB to be prefetched, &gt;= 0
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-set-prefetch-lob-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt bei Erfolg <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.oci-set-prefetch-lob-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Changing the LOB prefetch value for a query</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'hr'</span><span style="color: #007700">, </span><span style="color: #DD0000">'welcome'</span><span style="color: #007700">, </span><span style="color: #DD0000">'localhost/XE'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$stid </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_parse</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">, </span><span style="color: #DD0000">'SELECT myclob FROM mytable'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_set_prefetch_lob</span><span style="color: #007700">(</span><span style="color: #0000BB">$stid</span><span style="color: #007700">, </span><span style="color: #0000BB">100000</span><span style="color: #007700">);  </span><span style="color: #FF8000">// Set before calling oci_execute()<br /></span><span style="color: #0000BB">oci_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$stid</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"&lt;table border='1'&gt;\n"</span><span style="color: #007700">;<br />while (</span><span style="color: #0000BB">$row </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$stid</span><span style="color: #007700">, </span><span style="color: #0000BB">OCI_ASSOC</span><span style="color: #007700">+</span><span style="color: #0000BB">OCI_RETURN_NULLS</span><span style="color: #007700">+</span><span style="color: #0000BB">OCI_RETURN_LOBS</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"&lt;tr&gt;\n"</span><span style="color: #007700">;<br />    foreach (</span><span style="color: #0000BB">$row </span><span style="color: #007700">as </span><span style="color: #0000BB">$item</span><span style="color: #007700">) {<br />        echo </span><span style="color: #DD0000">"    &lt;td&gt;"</span><span style="color: #007700">.(</span><span style="color: #0000BB">$item </span><span style="color: #007700">!== </span><span style="color: #0000BB">null </span><span style="color: #007700">? </span><span style="color: #0000BB">htmlentities</span><span style="color: #007700">(</span><span style="color: #0000BB">$item</span><span style="color: #007700">, </span><span style="color: #0000BB">ENT_QUOTES</span><span style="color: #007700">) : </span><span style="color: #DD0000">"&amp;nbsp;"</span><span style="color: #007700">).</span><span style="color: #DD0000">"&lt;/td&gt;\n"</span><span style="color: #007700">;<br />    }<br />    echo </span><span style="color: #DD0000">"&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />}<br />echo </span><span style="color: #DD0000">"&lt;/table&gt;\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">oci_free_statement</span><span style="color: #007700">(</span><span style="color: #0000BB">$stid</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.oci-set-prefetch-lob-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li>
     <a href="oci8.configuration.php#ini.oci8.prefetch-lob-size" class="link">oci8.prefetch_lob_size</a>
     ini option
    </li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>