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