xref: /PHP-5.4/ext/oci8/tests/fetch.phpt (revision c7a8bd6a)
1--TEST--
2ocifetch() & ociresult()
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 fetch_tab",
14    "create table fetch_tab (id number, value number)",
15    "insert into fetch_tab (id, value) values (1,1)",
16    "insert into fetch_tab (id, value) values (1,1)",
17    "insert into fetch_tab (id, value) values (1,1)",
18);
19
20oci8_test_sql_execute($c, $stmtarray);
21
22// Run Test
23
24if (!($s = oci_parse($c, "select * from fetch_tab"))) {
25	die("oci_parse(select) failed!\n");
26}
27
28if (!oci_execute($s)) {
29	die("oci_execute(select) failed!\n");
30}
31
32while(ocifetch($s)) {
33		$row = ociresult($s, 1);
34		$row1 = ociresult($s, 2);
35		var_dump($row);
36		var_dump($row1);
37}
38
39// Cleanup
40
41$stmtarray = array(
42    "drop table fetch_tab"
43);
44
45oci8_test_sql_execute($c, $stmtarray);
46
47echo "Done\n";
48?>
49--EXPECTF--
50%unicode|string%(1) "1"
51%unicode|string%(1) "1"
52%unicode|string%(1) "1"
53%unicode|string%(1) "1"
54%unicode|string%(1) "1"
55%unicode|string%(1) "1"
56Done
57