1--TEST--
2Oracle Database 12c Implicit Result Sets: using SQL 'CALL'
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
9require __DIR__.'/skipif.inc';
10preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);
11if (!(isset($matches[0]) && $matches[1] >= 12)) {
12    die("skip expected output only valid when using Oracle Database 12c or greater");
13}
14preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
15if (!(isset($matches[0]) && $matches[0] >= 12)) {
16    die("skip works only with Oracle 12c or greater version of Oracle client libraries");
17}
18?>
19--FILE--
20<?php
21
22require __DIR__.'/connect.inc';
23
24// Initialization
25
26$stmtarray = array(
27    "create or replace procedure imp_res_call_err_proc as
28      c1 sys_refcursor;
29    begin
30      open c1 for select * from dual;
31      dbms_sql.return_result(c1);
32      open c1 for select * from dual;
33      dbms_sql.return_result (c1);
34    end;");
35
36oci8_test_sql_execute($c, $stmtarray);
37
38// Run Test
39
40echo "Test 1\n";
41
42$s = oci_parse($c, "call imp_res_call_err_proc()");
43oci_execute($s);
44
45// Clean up
46
47$stmtarray = array(
48    "drop procedure imp_res_call_err_proc"
49);
50
51oci8_test_sql_execute($c, $stmtarray);
52
53?>
54--EXPECTF--
55Test 1
56
57Warning: oci_execute(): ORA-29478: %s
58ORA-06512: at "SYS.DBMS_SQL", line %d
59ORA-06512: at "SYS.DBMS_SQL", line %d
60ORA-06512: at "%s.IMP_RES_CALL_ERR_PROC", line %d in %simp_res_call_error.php on line %d
61