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