reference/oci8/functions/oci-set-prefetch.xml
f80105b4fc1196bd8d5fecb98d686b580b1ff65d
...
...
@@ -47,18 +47,24 @@
47
47
processing the current set of rows.
48
48
</para>
49
49
<para>
50
-
Query prefetching was introduced in Oracle 8i. REF CURSOR
51
-
prefetching was introduced in Oracle 11gR2 and occurs when PHP is
52
-
linked with Oracle 11gR2 Client libraries and connected to 11gR2 or
53
-
previous versions of the database. Nested cursor prefetching was
54
-
introduced in Oracle 11gR2 and requires both the Oracle Client
55
-
libraries and the database to be version 11gR2.
50
+
Query prefetching was introduced in Oracle 8<emphasis>i</emphasis>. REF CURSOR
51
+
prefetching was introduced in Oracle 11<emphasis>g</emphasis>R2 and occurs when PHP is
52
+
linked with Oracle 11<emphasis>g</emphasis>R2 (or later) Client libraries.
53
+
Nested cursor prefetching was
54
+
introduced in Oracle 11<emphasis>g</emphasis>R2 and requires both the Oracle Client
55
+
libraries and the database to be version 11<emphasis>g</emphasis>R2 or greater.
56
56
</para>
57
57
<para>
58
58
Prefetching is not supported when queries contain LONG or LOB
59
59
columns. The prefetch value is ignored and single-row fetches will
60
60
be used in all the situations when prefetching is not supported.
61
61
</para>
62
+
<para>
63
+
When using Oracle Database 12<emphasis>c</emphasis>, the prefetch
64
+
value set by PHP can be overridden by Oracle's
65
+
client <literal>oraaccess.xml</literal> configuration file. Refer
66
+
to Oracle documentation for more detail.
67
+
</para>
62
68
</refsect1>
63
69

64
70
<refsect1 role="parameters">
...
...
@@ -90,39 +96,6 @@
90
96
</para>
91
97
</refsect1>
92
98

93
-
<refsect1 role="changelog">
94
-
&reftitle.changelog;
95
-
<para>
96
-
<informaltable>
97
-
<tgroup cols="2">
98
-
<thead>
99
-
<row>
100
-
<entry>&Version;</entry>
101
-
<entry>&Description;</entry>
102
-
</row>
103
-
</thead>
104
-
<tbody>
105
-
<row>
106
-
<entry>PHP 5.3.2 (PECL OCI8 1.4)</entry>
107
-
<entry>
108
-
Before this release, <parameter>rows</parameter> must be &gt;= 1.
109
-
</entry>
110
-
</row>
111
-
<row>
112
-
<entry>PHP 5.3 (PECL OCI8 1.3.4)</entry>
113
-
<entry>
114
-
Before this release, prefetching was limited to the lesser
115
-
of <parameter>rows</parameter> rows and 1024
116
-
* <parameter>rows</parameter> bytes. The byte size
117
-
restriction has now been removed.
118
-
</entry>
119
-
</row>
120
-
</tbody>
121
-
</tgroup>
122
-
</informaltable>
123
-
</para>
124
-
</refsect1>
125
-

126
99
<refsect1 role="examples">
127
100
&reftitle.examples;
128
101
<para>
...
...
@@ -179,7 +152,7 @@ oci_bind_by_name($stid, ':rc', $refcur, -1, OCI_B_CURSOR);
179
152
oci_execute($stid);
180
153

181
154
// Change the prefetch before executing the cursor.
182
-
// REF CURSOR prefetching works when PHP is linked with Oracle 11gR2 Client libraries
155
+
// REF CURSOR prefetching works when PHP is linked with Oracle 11gR2 or later Client libraries
183
156
oci_set_prefetch($refcur, 200);
184
157
oci_execute($refcur);
185
158

...
...
@@ -205,10 +178,10 @@ oci_close($conn);
205
178
<para>
206
179
If PHP OCI8 fetches from a REF CURSOR and then passes the REF
207
180
CURSOR back to a second PL/SQL procedure for further processing,
208
-
then set the REF CURSOR prefetch count to <constant>0</constant> to
181
+
then set the REF CURSOR prefetch count to <literal>0</literal> to
209
182
avoid rows being "lost" from the result set. The prefetch value is
210
183
the number of extra rows fetched in each OCI8 internal request to
211
-
the database, so setting it to <constant>0</constant> means only
184
+
the database, so setting it to <literal>0</literal> means only
212
185
fetch one row at a time.
213
186
<example>
214
187
<title>Setting the prefetch value when passing a REF CURSOR back to Oracle</title>
...
...
@@ -226,7 +199,6 @@ oci_execute($stid);
226
199

227
200
// Display two rows, but don't prefetch any extra rows otherwise
228
201
// those extra rows would not be passed back to myproc_use_rc().
229
-
// A prefetch value of 0 is allowed in PHP 5.3.2 and PECL OCI8 1.4
230
202
oci_set_prefetch($refcur, 0);
231
203
oci_execute($refcur);
232
204
$row = oci_fetch_array($refcur);
...
...
@@ -247,15 +219,6 @@ oci_execute($stid);
247
219
</para>
248
220
</refsect1>
249
221

250
-
<refsect1 role="notes">
251
-
&reftitle.notes;
252
-
<note>
253
-
<para>
254
-
In PHP versions before 5.0.0 use <function>ocisetprefetch</function> instead. &oci.name.compat.note;
255
-
</para>
256
-
</note>
257
-
</refsect1>
258
-

259
222
<refsect1 role="seealso">
260
223
&reftitle.seealso;
261
224
<para>
262
225