prefetch_old.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --TEST--
  2. ocisetprefetch()
  3. --SKIPIF--
  4. <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
  5. --FILE--
  6. <?php
  7. require(dirname(__FILE__)."/connect.inc");
  8. $stmtarray = array(
  9. "drop table prefetch_old_tab",
  10. "create table prefetch_old_tab (id number, value number)",
  11. "insert into prefetch_old_tab (id, value) values (1,1)",
  12. "insert into prefetch_old_tab (id, value) values (1,1)",
  13. "insert into prefetch_old_tab (id, value) values (1,1)",
  14. );
  15. oci8_test_sql_execute($c, $stmtarray);
  16. // Run Test
  17. if (!ocicommit($c)) {
  18. die("ocicommit() failed!\n");
  19. }
  20. $select_sql = "select * from prefetch_old_tab";
  21. if (!($s = ociparse($c, $select_sql))) {
  22. die("ociparse(select) failed!\n");
  23. }
  24. var_dump(ocisetprefetch($s, 10));
  25. if (!ociexecute($s)) {
  26. die("ociexecute(select) failed!\n");
  27. }
  28. var_dump(ocifetch($s));
  29. var_dump(ocirowcount($s));
  30. // Cleanup
  31. $stmtarray = array(
  32. "drop table prefetch_old_tab"
  33. );
  34. oci8_test_sql_execute($c, $stmtarray);
  35. echo "Done\n";
  36. ?>
  37. --EXPECT--
  38. bool(true)
  39. bool(true)
  40. int(1)
  41. Done