Annotation of embedaddon/php/ext/oci8/tests/fetch_into.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ocifetchinto()
3: --SKIPIF--
4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
5: --FILE--
6: <?php
7:
8: require(dirname(__FILE__)."/connect.inc");
9:
10: // Initialize
11:
12: $stmtarray = array(
13: "drop table fetch_into_tab",
14: "create table fetch_into_tab (id number, value number)",
15: "insert into fetch_into_tab (id, value) values (1,1)",
16: "insert into fetch_into_tab (id, value) values (1,1)",
17: "insert into fetch_into_tab (id, value) values (1,1)",
18: );
19:
20: oci8_test_sql_execute($c, $stmtarray);
21:
22: // Run Test
23:
24: if (!($s = oci_parse($c, "select * from fetch_into_tab"))) {
25: die("oci_parse(select) failed!\n");
26: }
27:
28: /* ocifetchinto */
29: if (!oci_execute($s)) {
30: die("oci_execute(select) failed!\n");
31: }
32: var_dump(ocifetchinto($s, $all));
33: var_dump($all);
34:
35: /* ocifetchinto */
36: if (!oci_execute($s)) {
37: die("oci_execute(select) failed!\n");
38: }
39: var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS));
40: var_dump($all);
41:
42: // Cleanup
43:
44: $stmtarray = array(
45: "drop table fetch_into_tab"
46: );
47:
48: oci8_test_sql_execute($c, $stmtarray);
49:
50: echo "Done\n";
51: ?>
52: --EXPECTF--
53: int(2)
54: array(2) {
55: [0]=>
56: %unicode|string%(1) "1"
57: [1]=>
58: %unicode|string%(1) "1"
59: }
60: int(2)
61: array(4) {
62: [0]=>
63: %unicode|string%(1) "1"
64: [%u|b%"ID"]=>
65: %unicode|string%(1) "1"
66: [1]=>
67: %unicode|string%(1) "1"
68: [%u|b%"VALUE"]=>
69: %unicode|string%(1) "1"
70: }
71: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>