error_bind_3.phpt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Test some more oci_bind_by_name error conditions
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('oci8')) die ("skip no oci8 extension");
  6. $target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
  7. require(dirname(__FILE__).'/skipif.inc');
  8. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches);
  9. if (!(isset($matches[0]) && $matches[1] >= 12)) {
  10. die("skip expected output only valid when using Oracle Database 12c or greater");
  11. }
  12. preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
  13. if (!(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. require(dirname(__FILE__).'/connect.inc');
  20. $sql = "begin
  21. :output1 := 99;
  22. :output2 := 'abc';
  23. end;";
  24. $s = oci_parse($c, $sql);
  25. oci_bind_by_name($s, ':output1', $output1, -1, OCI_B_BOL);
  26. oci_bind_by_name($s, ':output2', $output2, -1, OCI_B_BOL);
  27. oci_execute($s);
  28. var_dump($output1);
  29. var_dump($output2);
  30. echo "Done\n";
  31. ?>
  32. --EXPECTF--
  33. Warning: oci_execute(): ORA-06550: line %d, column %d:
  34. PLS-00382: %s
  35. ORA-06550: line %d, column %d:
  36. PL/SQL: %s
  37. ORA-06550: line %d, column %d:
  38. PLS-00382: %s
  39. ORA-06550: line %d, column %d:
  40. PL/SQL: %s in %s on line %d
  41. bool(false)
  42. bool(false)
  43. Done