Annotation of embedaddon/php/ext/oci8/tests/bug32325.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #32325 (Cannot retrieve collection using OCI8)
3: --SKIPIF--
4: <?php
5: $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
6: require(dirname(__FILE__).'/skipif.inc');
7: ?>
8: --FILE--
9: <?php
10:
11: require(dirname(__FILE__).'/connect.inc');
12:
13: // Initialize
14:
15: $stmtarray = array(
16: "create or replace type bug32325_t as table of number"
17: );
18:
19: oci8_test_sql_execute($c, $stmtarray);
20:
21: // Run test
22:
23: $collection = oci_new_collection($c, "BUG32325_T");
24:
25: $sql = "begin
26: select bug32325_t(1,2,3,4) into :list from dual;
27: end;";
28:
29: $stmt = oci_parse($c, $sql);
30:
31: oci_bind_by_name($stmt, ":list", $collection, -1, OCI_B_NTY);
32: oci_execute($stmt);
33:
34: var_dump($collection->size());
35: var_dump($collection->getelem(1));
36: var_dump($collection->getelem(2));
37:
38: // Cleanup
39:
40: $stmtarray = array(
41: "drop type bug32325_t"
42: );
43:
44: oci8_test_sql_execute($c, $stmtarray);
45:
46: echo "Done\n";
47: ?>
48: --EXPECT--
49: int(4)
50: float(2)
51: float(3)
52: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>