xref: /PHP-8.3/ext/oci8/tests/prefetch.phpt (revision a53e5617)
1--TEST--
2oci_set_prefetch()
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11
12require __DIR__.'/connect.inc';
13
14// Initialize
15
16$stmtarray = array(
17    "drop table prefetch_tab",
18    "create table prefetch_tab (id number, value number)",
19    "insert into prefetch_tab (id, value) values (1,1)",
20    "insert into prefetch_tab (id, value) values (1,1)",
21    "insert into prefetch_tab (id, value) values (1,1)",
22);
23
24oci8_test_sql_execute($c, $stmtarray);
25
26// Run Test
27
28$select_sql = "select * from prefetch_tab";
29
30if (!($s = oci_parse($c, $select_sql))) {
31    die("oci_parse(select) failed!\n");
32}
33
34var_dump(oci_set_prefetch($s, 10));
35
36if (!oci_execute($s)) {
37    die("oci_execute(select) failed!\n");
38}
39
40var_dump(oci_fetch($s));
41var_dump(oci_num_rows($s));
42
43// Cleanup
44
45$stmtarray = array(
46    "drop table prefetch_tab"
47);
48
49oci8_test_sql_execute($c, $stmtarray);
50
51echo "Done\n";
52?>
53--EXPECT--
54bool(true)
55bool(true)
56int(1)
57Done
58