xref: /PHP-8.1/ext/oci8/tests/error.phpt (revision b5a14e6c)
1--TEST--
2oci_error() error message for parsing error
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs: different error messages from TimesTen
8require(__DIR__.'/skipif.inc');
9?>
10--FILE--
11<?php
12
13require __DIR__."/connect.inc";
14
15if (!empty($dbase)) {
16    var_dump(oci_connect($user, $password, $dbase));
17}
18else {
19    var_dump(oci_connect($user, $password));
20}
21
22var_dump($s = oci_parse($c, "WRONG SYNTAX"));
23var_dump(oci_execute($s));
24var_dump(oci_error($s));
25
26echo "Done\n";
27
28?>
29--EXPECTF--
30resource(%s) of type (oci8 connection)
31resource(%s) of type (oci8 statement)
32
33Warning: oci_execute(): ORA-00900: %s in %s on line %d
34bool(false)
35array(4) {
36  ["code"]=>
37  int(900)
38  ["message"]=>
39  string(%d) "ORA-00900: %s"
40  ["offset"]=>
41  int(0)
42  ["sqltext"]=>
43  string(12) "WRONG SYNTAX"
44}
45Done
46