xref: /PHP-8.0/ext/oci8/tests/error_bind_3.phpt (revision 26dfce7f)
1--TEST--
2Test some more oci_bind_by_name error conditions
3--SKIPIF--
4<?php
5if (!extension_loaded('oci8')) die ("skip no oci8 extension");
6$target_dbs = array('oracledb' => true, 'timesten' => true);  // test runs on these DBs
7require(__DIR__.'/skipif.inc');
8preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);
9if (!(isset($matches[0]) && $matches[1] >= 12)) {
10    die("skip expected output only valid when using Oracle Database 12c or greater");
11}
12preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
13if (!(isset($matches[0]) && $matches[0] >= 12)) {
14    die("skip works only with Oracle 12c or greater version of Oracle client libraries");
15}
16?>
17--FILE--
18<?php
19
20require(__DIR__.'/connect.inc');
21
22$sql = "begin
23        :output1 := 99;
24        :output2 := 'abc';
25       end;";
26
27$s = oci_parse($c, $sql);
28oci_bind_by_name($s, ':output1', $output1, -1, OCI_B_BOL);
29oci_bind_by_name($s, ':output2', $output2, -1, OCI_B_BOL);
30oci_execute($s);
31var_dump($output1);
32var_dump($output2);
33
34echo "Done\n";
35
36?>
37--EXPECTF--
38Warning: oci_execute(): ORA-06550: line %d, column %d:
39PLS-00382: %s
40ORA-06550: line %d, column %d:
41PL/SQL: %s
42ORA-06550: line %d, column %d:
43PLS-00382: %s
44ORA-06550: line %d, column %d:
45PL/SQL: %s in %s on line %d
46bool(false)
47bool(false)
48Done
49