xref: /PHP-8.3/ext/oci8/tests/error_bind_3.phpt (revision a53e5617)
1--TEST--
2Test some more oci_bind_by_name error conditions
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8$target_dbs = array('oracledb' => true, 'timesten' => true);  // 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$sql = "begin
25        :output1 := 99;
26        :output2 := 'abc';
27       end;";
28
29$s = oci_parse($c, $sql);
30oci_bind_by_name($s, ':output1', $output1, -1, OCI_B_BOL);
31oci_bind_by_name($s, ':output2', $output2, -1, OCI_B_BOL);
32oci_execute($s);
33var_dump($output1);
34var_dump($output2);
35
36echo "Done\n";
37
38?>
39--EXPECTF--
40Warning: oci_execute(): ORA-06550: line %d, column %d:
41PLS-00382: %s
42ORA-06550: line %d, column %d:
43PL/SQL: %s
44ORA-06550: line %d, column %d:
45PLS-00382: %s
46ORA-06550: line %d, column %d:
47PL/SQL: %s in %s on line %d
48bool(false)
49bool(false)
50Done
51