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