xref: /PHP-5.5/ext/oci8/tests/prefetch_old.phpt (revision c7a8bd6a)
1--TEST--
2ocisetprefetch()
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$stmtarray = array(
11    "drop table prefetch_old_tab",
12    "create table prefetch_old_tab (id number, value number)",
13    "insert into prefetch_old_tab (id, value) values (1,1)",
14    "insert into prefetch_old_tab (id, value) values (1,1)",
15    "insert into prefetch_old_tab (id, value) values (1,1)",
16);
17
18oci8_test_sql_execute($c, $stmtarray);
19
20// Run Test
21
22if (!ocicommit($c)) {
23	die("ocicommit() failed!\n");
24}
25
26$select_sql = "select * from prefetch_old_tab";
27
28if (!($s = ociparse($c, $select_sql))) {
29	die("ociparse(select) failed!\n");
30}
31
32var_dump(ocisetprefetch($s, 10));
33
34if (!ociexecute($s)) {
35	die("ociexecute(select) failed!\n");
36}
37
38var_dump(ocifetch($s));
39var_dump(ocirowcount($s));
40
41
42// Cleanup
43
44$stmtarray = array(
45    "drop table prefetch_old_tab"
46);
47
48oci8_test_sql_execute($c, $stmtarray);
49
50echo "Done\n";
51?>
52--EXPECT--
53bool(true)
54bool(true)
55int(1)
56Done
57