fetch_into2.phpt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. --TEST--
  2. ocifetchinto() & wrong number of params
  3. --SKIPIF--
  4. <?php
  5. $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
  6. require(dirname(__FILE__).'/skipif.inc');
  7. ?>
  8. --FILE--
  9. <?php
  10. require dirname(__FILE__)."/connect.inc";
  11. require dirname(__FILE__).'/create_table.inc';
  12. $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)";
  13. if (!($s = oci_parse($c, $insert_sql))) {
  14. die("oci_parse(insert) failed!\n");
  15. }
  16. for ($i = 0; $i<20; $i++) {
  17. if (!oci_execute($s)) {
  18. die("oci_execute(insert) failed!\n");
  19. }
  20. }
  21. if (!oci_commit($c)) {
  22. die("oci_commit() failed!\n");
  23. }
  24. $select_sql = "SELECT * FROM ".$schema."".$table_name."";
  25. if (!($s = oci_parse($c, $select_sql))) {
  26. die("oci_parse(select) failed!\n");
  27. }
  28. if (!oci_execute($s)) {
  29. die("oci_execute(select) failed!\n");
  30. }
  31. var_dump(ocifetchinto($s));
  32. var_dump($all);
  33. var_dump(ocifetchinto($s, $all, OCI_ASSOC, 5));
  34. var_dump($all);
  35. var_dump(ocifetchinto($c, $all, OCI_RETURN_LOBS));
  36. var_dump($all);
  37. var_dump(ocifetchinto($s, $all, 1000000));
  38. var_dump($all);
  39. require dirname(__FILE__).'/drop_table.inc';
  40. echo "Done\n";
  41. ?>
  42. --EXPECTF--
  43. Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d
  44. NULL
  45. Notice: Undefined variable: all in %s on line %d
  46. NULL
  47. Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d
  48. NULL
  49. NULL
  50. Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d
  51. bool(false)
  52. NULL
  53. int(5)
  54. array(2) {
  55. [0]=>
  56. string(1) "1"
  57. [1]=>
  58. string(1) "1"
  59. }
  60. Done