prefetch.phpt 910 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. oci_set_prefetch()
  3. --EXTENSIONS--
  4. oci8
  5. --FILE--
  6. <?php
  7. require(__DIR__."/connect.inc");
  8. // Initialize
  9. $stmtarray = array(
  10. "drop table prefetch_tab",
  11. "create table prefetch_tab (id number, value number)",
  12. "insert into prefetch_tab (id, value) values (1,1)",
  13. "insert into prefetch_tab (id, value) values (1,1)",
  14. "insert into prefetch_tab (id, value) values (1,1)",
  15. );
  16. oci8_test_sql_execute($c, $stmtarray);
  17. // Run Test
  18. $select_sql = "select * from prefetch_tab";
  19. if (!($s = oci_parse($c, $select_sql))) {
  20. die("oci_parse(select) failed!\n");
  21. }
  22. var_dump(oci_set_prefetch($s, 10));
  23. if (!oci_execute($s)) {
  24. die("oci_execute(select) failed!\n");
  25. }
  26. var_dump(oci_fetch($s));
  27. var_dump(oci_num_rows($s));
  28. // Cleanup
  29. $stmtarray = array(
  30. "drop table prefetch_tab"
  31. );
  32. oci8_test_sql_execute($c, $stmtarray);
  33. echo "Done\n";
  34. ?>
  35. --EXPECT--
  36. bool(true)
  37. bool(true)
  38. int(1)
  39. Done