Annotation of embedaddon/php/ext/oci8/tests/cursor_bind_err.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: binding a cursor (with errors)
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: "drop table cursor_bind_err_tab",
17: "create table cursor_bind_err_tab (id number, value number)",
18: "insert into cursor_bind_err_tab (id, value) values (1,1)",
19: "insert into cursor_bind_err_tab (id, value) values (1,1)",
20: "insert into cursor_bind_err_tab (id, value) values (1,1)",
21: );
22:
23: oci8_test_sql_execute($c, $stmtarray);
24:
25: // Run Test
26:
27: $sql = "select cursor(select * from cursor_bind_err_tab) into :cursor from dual";
28: $stmt = oci_parse($c, $sql);
29:
30: $cursor = oci_new_cursor($c);
31: oci_bind_by_name($stmt, ":cursor", $cursor, -1, OCI_B_CURSOR);
32:
33: oci_execute($stmt);
34:
35: oci_execute($cursor);
36: var_dump(oci_fetch_assoc($cursor));
37:
38: // Cleanup
39:
40: $stmtarray = array(
41: "drop table cursor_bind_err_tab"
42: );
43:
44: oci8_test_sql_execute($c, $stmtarray);
45:
46: echo "Done\n";
47:
48: ?>
49: --EXPECTF--
50: Warning: oci_bind_by_name(): ORA-01036: %s in %s on line %d
51:
52: Warning: oci_fetch_assoc(): ORA-24338: %s in %s on line %d
53: bool(false)
54: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>